home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Technical Documentation / Mac Tech Notes (DocViewer) / TN-Processes < prev    next >
MacBinary  |  1993-01-05  |  192.0 KB  |  [ONLN/HLX2]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Tue Dec 22 11:41:00 1992, modified Tue Jan 5 10:06:57 1993, creator 'HLX2', type 'ONLN', 189740 bytes "TN-Processes" , at 0x2e5ac 6545 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[ONLN]
macFileCreator[HLX2]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 54 4e 2d 50 72 6f | 63 65 73 73 65 73 00 00 |..TN-Pro|cesses..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 02 e5 2c 00 | 00 19 91 a7 5c f5 9c a7 |......,.|....\...|
|00000060| 6f 54 91 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |oT......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 d9 de 00 00 |........|........|
|00000080| 42 61 63 6b 67 72 6f 75 | 6e 64 2d 4f 6e 6c 79 20 |Backgrou|nd-Only |
|00000090| 41 70 70 6c 69 63 61 74 | 69 6f 6e 73 0d 50 72 6f |Applicat|ions.Pro|
|000000a0| 63 65 73 73 65 73 09 4d | 2e 50 53 2e 42 61 63 6b |cesses.M|.PS.Back|
|000000b0| 67 72 6f 75 6e 64 4f 6e | 6c 79 41 70 70 0d 57 72 |groundOn|lyApp.Wr|
|000000c0| 69 74 74 65 6e 20 62 79 | 3a 09 47 72 65 67 20 52 |itten by|:.Greg R|
|000000d0| 6f 62 62 69 6e 73 20 61 | 6e 64 20 43 2e 20 4b 2e |obbins a|nd C. K.|
|000000e0| 20 48 61 75 6e 09 44 65 | 63 65 6d 62 65 72 20 31 | Haun.De|cember 1|
|000000f0| 39 39 32 0d 42 61 63 6b | 67 72 6f 75 6e 64 2d 6f |992.Back|ground-o|
|00000100| 6e 6c 79 20 61 70 70 6c | 69 63 61 74 69 6f 6e 73 |nly appl|ications|
|00000110| 20 28 42 4f 41 73 29 20 | 61 72 65 20 4d 61 63 69 | (BOAs) |are Maci|
|00000120| 6e 74 6f 73 68 20 61 70 | 70 6c 69 63 61 74 69 6f |ntosh ap|plicatio|
|00000130| 6e 73 20 74 68 61 74 20 | 72 75 6e 20 6f 6e 6c 79 |ns that |run only|
|00000140| 20 69 6e 20 74 68 65 20 | 62 61 63 6b 67 72 6f 75 | in the |backgrou|
|00000150| 6e 64 20 75 6e 64 65 72 | 20 4d 75 6c 74 69 46 69 |nd under| MultiFi|
|00000160| 6e 64 65 72 20 61 6e 64 | 20 75 6e 64 65 72 20 53 |nder and| under S|
|00000170| 79 73 74 65 6d 20 37 2e | 20 42 4f 41 73 20 61 72 |ystem 7.| BOAs ar|
|00000180| 65 20 74 68 65 20 70 72 | 65 66 65 72 72 65 64 20 |e the pr|eferred |
|00000190| 61 6c 74 65 72 6e 61 74 | 69 76 65 20 74 6f 20 49 |alternat|ive to I|
|000001a0| 4e 49 54 73 2c 20 64 72 | 69 76 65 72 73 2c 20 61 |NITs, dr|ivers, a|
|000001b0| 6e 64 20 73 74 61 6e 64 | 2d 61 6c 6f 6e 65 20 63 |nd stand|-alone c|
|000001c0| 6f 64 65 20 66 6f 72 20 | 6d 6f 73 74 20 73 74 61 |ode for |most sta|
|000001d0| 72 74 75 70 2d 74 69 6d | 65 20 61 6e 64 20 62 61 |rtup-tim|e and ba|
|000001e0| 63 6b 67 72 6f 75 6e 64 | 20 d2 64 61 65 6d 6f 6e |ckground| .daemon|
|000001f0| d3 20 73 65 72 76 69 63 | 65 73 2e 20 54 68 69 73 |. servic|es. This|
|00000200| 20 6e 6f 74 65 20 64 69 | 73 63 75 73 73 65 73 20 | note di|scusses |
|00000210| 76 61 72 69 6f 75 73 20 | 69 73 73 75 65 73 20 74 |various |issues t|
|00000220| 68 61 74 20 61 66 66 65 | 63 74 20 64 65 76 65 6c |hat affe|ct devel|
|00000230| 6f 70 6d 65 6e 74 20 6f | 66 20 42 4f 41 73 2c 20 |opment o|f BOAs, |
|00000240| 61 73 20 77 65 6c 6c 20 | 61 73 20 75 73 65 66 75 |as well |as usefu|
|00000250| 6c 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |l implem|entation|
|00000260| 20 73 74 72 61 74 65 67 | 69 65 73 20 66 6f 72 20 | strateg|ies for |
|00000270| 42 4f 41 73 2e 0d 49 6e | 74 72 6f 64 75 63 74 69 |BOAs..In|troducti|
|00000280| 6f 6e 0d 42 61 63 6b 67 | 72 6f 75 6e 64 2d 6f 6e |on.Backg|round-on|
|00000290| 6c 79 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 73 20 |ly appli|cations |
|000002a0| 28 42 4f 41 73 29 2c 20 | 61 6c 73 6f 20 63 61 6c |(BOAs), |also cal|
|000002b0| 6c 65 64 20 66 61 63 65 | 6c 65 73 73 20 62 61 63 |led face|less bac|
|000002c0| 6b 67 72 6f 75 6e 64 20 | 61 70 70 6c 69 63 61 74 |kground |applicat|
|000002d0| 69 6f 6e 73 20 28 46 42 | 41 73 29 20 6f 72 20 61 |ions (FB|As) or a|
|000002e0| 70 70 6c 69 63 61 74 69 | 6f 6e 20 65 78 74 65 6e |pplicati|on exten|
|000002f0| 73 69 6f 6e 73 2c 20 61 | 72 65 20 74 68 65 20 65 |sions, a|re the e|
|00000300| 61 73 69 65 73 74 20 77 | 61 79 20 74 6f 20 70 72 |asiest w|ay to pr|
|00000310| 6f 76 69 64 65 20 65 69 | 74 68 65 72 20 73 74 61 |ovide ei|ther sta|
|00000320| 72 74 75 70 2d 74 69 6d | 65 20 6f 72 20 63 6f 6e |rtup-tim|e or con|
|00000330| 74 69 6e 75 6f 75 73 20 | 62 61 63 6b 67 72 6f 75 |tinuous |backgrou|
|00000340| 6e 64 20 73 65 72 76 69 | 63 65 73 2e 20 41 6c 74 |nd servi|ces. Alt|
|00000350| 68 6f 75 67 68 20 42 4f | 41 73 20 77 6f 72 6b 20 |hough BO|As work |
|00000360| 75 6e 64 65 72 20 53 79 | 73 74 65 6d 20 36 20 61 |under Sy|stem 6 a|
|00000370| 6e 64 20 4d 75 6c 74 69 | 46 69 6e 64 65 72 2c 20 |nd Multi|Finder, |
|00000380| 74 68 65 20 70 72 6f 63 | 65 73 73 20 6d 61 6e 61 |the proc|ess mana|
|00000390| 67 65 6d 65 6e 74 20 61 | 6e 64 20 69 6e 74 65 72 |gement a|nd inter|
|000003a0| 70 72 6f 63 65 73 73 20 | 63 6f 6d 6d 75 6e 69 63 |process |communic|
|000003b0| 61 74 69 6f 6e 20 66 61 | 63 69 6c 69 74 69 65 73 |ation fa|cilities|
|000003c0| 20 6f 66 20 53 79 73 74 | 65 6d 20 37 20 61 6c 6c | of Syst|em 7 all|
|000003d0| 6f 77 20 42 4f 41 73 20 | 74 6f 20 70 72 6f 76 69 |ow BOAs |to provi|
|000003e0| 64 65 20 66 61 72 20 6d | 6f 72 65 20 73 6f 70 68 |de far m|ore soph|
|000003f0| 69 73 74 69 63 61 74 65 | 64 20 73 65 72 76 69 63 |isticate|d servic|
|00000400| 65 73 2e 0d 54 68 69 73 | 20 6e 6f 74 65 20 63 6f |es..This| note co|
|00000410| 76 65 72 73 20 73 6f 6d | 65 20 6f 66 20 74 68 65 |vers som|e of the|
|00000420| 20 75 73 65 73 20 61 6e | 64 20 70 69 74 66 61 6c | uses an|d pitfal|
|00000430| 6c 73 20 6f 66 20 64 65 | 76 65 6c 6f 70 69 6e 67 |ls of de|veloping|
|00000440| 20 62 61 63 6b 67 72 6f | 75 6e 64 2d 6f 6e 6c 79 | backgro|und-only|
|00000450| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 73 2e 20 46 | applica|tions. F|
|00000460| 6f 72 20 61 6e 20 69 6e | 74 72 6f 64 75 63 74 69 |or an in|troducti|
|00000470| 6f 6e 20 74 6f 20 77 72 | 69 74 69 6e 67 20 42 4f |on to wr|iting BO|
|00000480| 41 73 2c 20 73 65 65 20 | d2 42 65 20 4f 75 72 20 |As, see |.Be Our |
|00000490| 47 75 65 73 74 d3 20 69 | 6e 20 69 73 73 75 65 20 |Guest. i|n issue |
|000004a0| 39 20 6f 66 20 64 65 76 | 65 6c 6f 70 2e 20 53 61 |9 of dev|elop. Sa|
|000004b0| 6d 70 6c 65 20 50 61 73 | 63 61 6c 20 61 6e 64 20 |mple Pas|cal and |
|000004c0| 43 20 63 6f 64 65 20 66 | 6f 72 20 62 61 63 6b 67 |C code f|or backg|
|000004d0| 72 6f 75 6e 64 2d 6f 6e | 6c 79 20 61 70 70 6c 69 |round-on|ly appli|
|000004e0| 63 61 74 69 6f 6e 73 20 | 69 73 20 61 76 61 69 6c |cations |is avail|
|000004f0| 61 62 6c 65 20 69 6e 20 | 74 68 65 20 53 6e 69 70 |able in |the Snip|
|00000500| 70 65 74 73 20 63 6f 6c | 6c 65 63 74 69 6f 6e 20 |pets col|lection |
|00000510| 6f 6e 20 74 68 65 20 44 | 65 76 65 6c 6f 70 65 72 |on the D|eveloper|
|00000520| 20 53 65 72 69 65 73 20 | 43 44 20 61 73 20 70 53 | Series |CD as pS|
|00000530| 6d 61 6c 6c 44 61 65 6d | 6f 6e 2e 70 20 61 6e 64 |mallDaem|on.p and|
|00000540| 20 63 53 6d 61 6c 6c 44 | 61 65 6d 6f 6e 2e 63 2e | cSmallD|aemon.c.|
|00000550| 0d 48 6f 77 20 74 6f 20 | 42 65 20 61 20 42 4f 41 |.How to |Be a BOA|
|00000560| 0d 42 61 63 6b 67 72 6f | 75 6e 64 2d 6f 6e 6c 79 |.Backgro|und-only|
|00000570| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 73 20 74 65 | applica|tions te|
|00000580| 6e 64 20 74 6f 20 6c 6f | 6f 6b 20 6c 69 6b 65 20 |nd to lo|ok like |
|00000590| 72 65 64 75 63 65 64 20 | 4d 61 63 69 6e 74 6f 73 |reduced |Macintos|
|000005a0| 68 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 73 2e 20 |h applic|ations. |
|000005b0| 41 20 42 4f 41 20 73 68 | 6f 75 6c 64 20 63 61 6c |A BOA sh|ould cal|
|000005c0| 6c 20 49 6e 69 74 47 72 | 61 66 20 74 6f 20 69 6e |l InitGr|af to in|
|000005d0| 69 74 69 61 6c 69 7a 65 | 20 51 75 69 63 6b 44 72 |itialize| QuickDr|
|000005e0| 61 77 20 67 6c 6f 62 61 | 6c 73 20 28 77 68 69 63 |aw globa|ls (whic|
|000005f0| 68 20 69 73 20 6e 65 63 | 65 73 73 61 72 79 20 74 |h is nec|essary t|
|00000600| 6f 20 75 73 65 20 74 68 | 65 20 41 70 70 6c 65 20 |o use th|e Apple |
|00000610| 45 76 65 6e 74 20 4d 61 | 6e 61 67 65 72 29 2c 20 |Event Ma|nager), |
|00000620| 62 75 74 20 61 20 42 4f | 41 20 6d 75 73 74 20 6e |but a BO|A must n|
|00000630| 6f 74 20 63 61 6c 6c 20 | 49 6e 69 74 57 69 6e 64 |ot call |InitWind|
|00000640| 6f 77 73 2c 20 49 6e 69 | 74 4d 65 6e 75 73 2c 20 |ows, Ini|tMenus, |
|00000650| 6f 72 20 61 6e 79 20 74 | 6f 6f 6c 62 6f 78 20 6f |or any t|oolbox o|
|00000660| 72 20 6f 70 65 72 61 74 | 69 6e 67 20 73 79 73 74 |r operat|ing syst|
|00000670| 65 6d 20 72 6f 75 74 69 | 6e 65 20 74 68 61 74 20 |em routi|ne that |
|00000680| 6d 69 67 68 74 20 64 72 | 61 77 20 6f 6e 20 74 68 |might dr|aw on th|
|00000690| 65 20 73 63 72 65 65 6e | 2e 20 54 68 69 73 20 72 |e screen|. This r|
|000006a0| 75 6c 65 73 20 6f 75 74 | 20 6d 61 6b 69 6e 67 20 |ules out| making |
|000006b0| 61 6e 79 20 63 61 6c 6c | 20 66 72 6f 6d 20 61 20 |any call| from a |
|000006c0| 42 4f 41 20 74 68 61 74 | 20 6d 69 67 68 74 20 72 |BOA that| might r|
|000006d0| 61 69 73 65 20 61 20 64 | 69 61 6c 6f 67 20 65 69 |aise a d|ialog ei|
|000006e0| 74 68 65 72 20 69 6e 74 | 65 6e 74 69 6f 6e 61 6c |ther int|entional|
|000006f0| 6c 79 20 28 6c 69 6b 65 | 20 50 50 43 42 72 6f 77 |ly (like| PPCBrow|
|00000700| 73 65 72 29 20 6f 72 20 | 75 6e 69 6e 74 65 6e 74 |ser) or |unintent|
|00000710| 69 6f 6e 61 6c 6c 79 20 | 28 6c 69 6b 65 20 52 65 |ionally |(like Re|
|00000720| 73 6f 6c 76 65 41 6c 69 | 61 73 29 2e 20 54 68 65 |solveAli|as). The|
|00000730| 72 65 20 61 72 65 20 74 | 79 70 69 63 61 6c 6c 79 |re are t|ypically|
|00000740| 20 61 6c 74 65 72 6e 61 | 74 69 76 65 20 72 6f 75 | alterna|tive rou|
|00000750| 74 69 6e 65 73 20 74 68 | 61 74 20 61 76 6f 69 64 |tines th|at avoid|
|00000760| 20 74 68 65 20 6e 65 65 | 64 20 66 6f 72 20 75 73 | the nee|d for us|
|00000770| 65 72 20 69 6e 74 65 72 | 61 63 74 69 6f 6e 20 28 |er inter|action (|
|00000780| 73 75 63 68 20 61 73 20 | 49 50 43 4c 69 73 74 50 |such as |IPCListP|
|00000790| 6f 72 74 73 20 61 6e 64 | 20 4d 61 74 63 68 41 6c |orts and| MatchAl|
|000007a0| 69 61 73 29 20 74 68 61 | 74 20 63 61 6e 20 62 65 |ias) tha|t can be|
|000007b0| 20 75 73 65 64 20 66 72 | 6f 6d 20 77 69 74 68 69 | used fr|om withi|
|000007c0| 6e 20 61 20 42 4f 41 2e | 20 4f 6e 65 2d 77 61 79 |n a BOA.| One-way|
|000007d0| 20 63 6f 6d 6d 75 6e 69 | 63 61 74 69 6f 6e 20 66 | communi|cation f|
|000007e0| 72 6f 6d 20 61 20 42 4f | 41 20 74 6f 20 74 68 65 |rom a BO|A to the|
|000007f0| 20 75 73 65 72 20 63 61 | 6e 20 62 65 20 64 6f 6e | user ca|n be don|
|00000800| 65 20 76 69 61 20 74 68 | 65 20 4e 6f 74 69 66 69 |e via th|e Notifi|
|00000810| 63 61 74 69 6f 6e 20 4d | 61 6e 61 67 65 72 20 28 |cation M|anager (|
|00000820| 73 65 65 20 d2 50 6f 73 | 74 69 6e 67 20 4e 6f 74 |see .Pos|ting Not|
|00000830| 69 66 69 63 61 74 69 6f | 6e 73 d3 20 6c 61 74 65 |ificatio|ns. late|
|00000840| 72 20 69 6e 20 74 68 69 | 73 20 6e 6f 74 65 29 2e |r in thi|s note).|
|00000850| 0d 4c 69 6b 65 20 61 6c | 6c 20 6f 74 68 65 72 20 |.Like al|l other |
|00000860| 4d 61 63 69 6e 74 6f 73 | 68 20 61 70 70 6c 69 63 |Macintos|h applic|
|00000870| 61 74 69 6f 6e 73 2c 20 | 61 20 42 4f 41 20 73 68 |ations, |a BOA sh|
|00000880| 6f 75 6c 64 20 68 61 6e | 64 6c 65 20 74 68 65 20 |ould han|dle the |
|00000890| 66 6f 75 72 20 72 65 71 | 75 69 72 65 64 20 41 70 |four req|uired Ap|
|000008a0| 70 6c 65 20 65 76 65 6e | 74 73 2e 20 49 74 20 69 |ple even|ts. It i|
|000008b0| 73 20 70 61 72 74 69 63 | 75 6c 61 72 6c 79 20 69 |s partic|ularly i|
|000008c0| 6d 70 6f 72 74 61 6e 74 | 20 74 68 61 74 20 74 68 |mportant| that th|
|000008d0| 65 20 51 75 69 74 41 70 | 70 6c 69 63 61 74 69 6f |e QuitAp|plicatio|
|000008e0| 6e 20 41 70 70 6c 65 20 | 65 76 65 6e 74 20 62 65 |n Apple |event be|
|000008f0| 20 73 75 70 70 6f 72 74 | 65 64 2c 20 61 73 20 53 | support|ed, as S|
|00000900| 79 73 74 65 6d 20 37 20 | 77 69 6c 6c 20 72 65 66 |ystem 7 |will ref|
|00000910| 75 73 65 20 74 6f 20 73 | 68 75 74 20 64 6f 77 6e |use to s|hut down|
|00000920| 20 69 66 20 61 20 42 4f | 41 20 64 6f 65 73 20 6e | if a BO|A does n|
|00000930| 6f 74 20 71 75 69 74 20 | 61 73 20 72 65 71 75 65 |ot quit |as reque|
|00000940| 73 74 65 64 2e 0d 42 65 | 20 73 75 72 65 20 74 6f |sted..Be| sure to|
|00000950| 20 73 65 74 20 74 68 65 | 20 63 61 6e 42 61 63 6b | set the| canBack|
|00000960| 67 72 6f 75 6e 64 20 61 | 6e 64 20 62 61 63 6b 67 |ground a|nd backg|
|00000970| 72 6f 75 6e 64 4f 6e 6c | 79 20 62 69 74 73 20 69 |roundOnl|y bits i|
|00000980| 6e 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |n the ap|plicatio|
|00000990| 6e d5 73 20 53 49 5a 45 | 20 2d 31 20 72 65 73 6f |n.s SIZE| -1 reso|
|000009a0| 75 72 63 65 20 74 6f 20 | 69 6e 64 69 63 61 74 65 |urce to |indicate|
|000009b0| 20 74 6f 20 74 68 65 20 | 73 79 73 74 65 6d 20 74 | to the |system t|
|000009c0| 68 61 74 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 |hat the |applicat|
|000009d0| 69 6f 6e 20 69 73 20 61 | 20 62 61 63 6b 67 72 6f |ion is a| backgro|
|000009e0| 75 6e 64 2d 6f 6e 6c 79 | 20 70 72 6f 63 65 73 73 |und-only| process|
|000009f0| 2e 0d 53 74 61 63 6b 20 | 49 73 73 75 65 73 0d 54 |..Stack |Issues.T|
|00000a00| 68 65 20 73 74 61 63 6b | 20 73 70 61 63 65 20 61 |he stack| space a|
|00000a10| 6c 6c 6f 63 61 74 65 64 | 20 74 6f 20 42 4f 41 73 |llocated| to BOAs|
|00000a20| 20 62 79 20 64 65 66 61 | 75 6c 74 20 69 73 20 6f | by defa|ult is o|
|00000a30| 6e 6c 79 20 32 4b 2e 20 | 54 68 69 73 20 69 73 20 |nly 2K. |This is |
|00000a40| 6d 75 63 68 20 73 6d 61 | 6c 6c 65 72 20 74 68 61 |much sma|ller tha|
|00000a50| 6e 20 74 68 65 20 75 73 | 75 61 6c 20 64 65 66 61 |n the us|ual defa|
|00000a60| 75 6c 74 20 73 74 61 63 | 6b 20 73 69 7a 65 20 6f |ult stac|k size o|
|00000a70| 66 20 38 4b 20 28 6f 6e | 20 4d 61 63 69 6e 74 6f |f 8K (on| Macinto|
|00000a80| 73 68 20 63 6f 6d 70 75 | 74 65 72 73 20 77 69 74 |sh compu|ters wit|
|00000a90| 68 6f 75 74 20 43 6f 6c | 6f 72 20 51 75 69 63 6b |hout Col|or Quick|
|00000aa0| 44 72 61 77 29 20 6f 72 | 20 32 34 4b 20 28 6f 6e |Draw) or| 24K (on|
|00000ab0| 20 4d 61 63 69 6e 74 6f | 73 68 20 6d 6f 64 65 6c | Macinto|sh model|
|00000ac0| 73 20 77 69 74 68 20 43 | 6f 6c 6f 72 20 51 75 69 |s with C|olor Qui|
|00000ad0| 63 6b 44 72 61 77 29 2e | 20 41 6e 79 20 72 65 63 |ckDraw).| Any rec|
|00000ae0| 75 72 73 69 76 65 20 6f | 72 20 73 74 61 63 6b 2d |ursive o|r stack-|
|00000af0| 69 6e 74 65 6e 73 69 76 | 65 20 6f 70 65 72 61 74 |intensiv|e operat|
|00000b00| 69 6f 6e 20 63 61 6e 20 | 65 61 73 69 6c 79 20 63 |ion can |easily c|
|00000b10| 61 75 73 65 20 74 68 65 | 20 42 4f 41 d5 73 20 73 |ause the| BOA.s s|
|00000b20| 74 61 63 6b 20 74 6f 20 | 63 72 61 73 68 20 69 6e |tack to |crash in|
|00000b30| 74 6f 20 69 74 73 20 68 | 65 61 70 2e 20 54 68 69 |to its h|eap. Thi|
|00000b40| 73 20 63 61 6e 20 74 79 | 70 69 63 61 6c 6c 79 20 |s can ty|pically |
|00000b50| 62 65 20 61 76 6f 69 64 | 65 64 20 62 79 20 75 73 |be avoid|ed by us|
|00000b60| 69 6e 67 20 73 74 61 6e | 64 61 72 64 20 6c 6f 6f |ing stan|dard loo|
|00000b70| 70 69 6e 67 20 63 6f 6e | 73 74 72 75 63 74 73 20 |ping con|structs |
|00000b80| 72 61 74 68 65 72 20 74 | 68 61 6e 20 72 65 63 75 |rather t|han recu|
|00000b90| 72 73 69 6f 6e 20 61 6e | 64 20 62 79 20 75 73 69 |rsion an|d by usi|
|00000ba0| 6e 67 20 68 65 61 70 20 | 61 6c 6c 6f 63 61 74 69 |ng heap |allocati|
|00000bb0| 6f 6e 73 20 28 4e 65 77 | 48 61 6e 64 6c 65 2c 20 |ons (New|Handle, |
|00000bc0| 4e 65 77 50 6f 69 6e 74 | 65 72 2c 20 6f 72 20 66 |NewPoint|er, or f|
|00000bd0| 6f 72 20 74 72 61 6e 73 | 69 74 6f 72 79 20 6e 65 |or trans|itory ne|
|00000be0| 65 64 73 2c 20 54 65 6d | 70 4e 65 77 48 61 6e 64 |eds, Tem|pNewHand|
|00000bf0| 6c 65 29 20 69 6e 73 74 | 65 61 64 20 6f 66 20 6c |le) inst|ead of l|
|00000c00| 61 72 67 65 20 70 61 72 | 61 6d 65 74 65 72 73 20 |arge par|ameters |
|00000c10| 6f 72 20 6c 6f 63 61 6c | 20 76 61 72 69 61 62 6c |or local| variabl|
|00000c20| 65 73 2e 20 42 65 20 63 | 61 72 65 66 75 6c 20 74 |es. Be c|areful t|
|00000c30| 6f 20 61 76 6f 69 64 20 | 64 65 63 6c 61 72 69 6e |o avoid |declarin|
|00000c40| 67 20 53 74 72 32 35 35 | 73 20 61 73 20 6c 6f 63 |g Str255|s as loc|
|00000c50| 61 6c 20 76 61 72 69 61 | 62 6c 65 73 2c 20 61 73 |al varia|bles, as|
|00000c60| 20 74 68 6f 73 65 20 77 | 69 6c 6c 20 71 75 69 63 | those w|ill quic|
|00000c70| 6b 6c 79 20 75 73 65 20 | 75 70 20 73 74 61 63 6b |kly use |up stack|
|00000c80| 20 73 70 61 63 65 2e 0d | 49 66 20 69 74 20 69 73 | space..|If it is|
|00000c90| 20 6e 65 63 65 73 73 61 | 72 79 20 74 6f 20 69 6e | necessa|ry to in|
|00000ca0| 63 72 65 61 73 65 20 61 | 20 42 4f 41 d5 73 20 73 |crease a| BOA.s s|
|00000cb0| 74 61 63 6b 2c 20 69 74 | 20 63 61 6e 20 62 65 20 |tack, it| can be |
|00000cc0| 64 6f 6e 65 20 62 79 20 | 63 61 6c 6c 69 6e 67 20 |done by |calling |
|00000cd0| 47 65 74 41 70 70 6c 4c | 69 6d 69 74 20 61 6e 64 |GetApplL|imit and|
|00000ce0| 20 53 65 74 41 70 70 6c | 4c 69 6d 69 74 20 74 6f | SetAppl|Limit to|
|00000cf0| 20 72 65 64 75 63 65 20 | 74 68 65 20 42 4f 41 d5 | reduce |the BOA.|
|00000d00| 73 20 68 65 61 70 20 73 | 70 61 63 65 3a 0d 20 20 |s heap s|pace:. |
|00000d10| 2f 2f 20 49 6e 63 72 65 | 61 73 65 20 74 68 65 20 |// Incre|ase the |
|00000d20| 73 70 61 63 65 20 61 6c | 6c 6f 63 61 74 65 64 20 |space al|located |
|00000d30| 66 6f 72 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 |for the |applicat|
|00000d40| 69 6f 6e 20 73 74 61 63 | 6b 2e 0d 20 20 2f 2f 0d |ion stac|k.. //.|
|00000d50| 20 20 2f 2f 20 57 61 72 | 6e 69 6e 67 3a 20 53 65 | // War|ning: Se|
|00000d60| 74 41 70 70 6c 4c 69 6d | 69 74 20 61 6c 77 61 79 |tApplLim|it alway|
|00000d70| 73 20 73 65 74 73 20 74 | 68 65 20 73 74 61 63 6b |s sets t|he stack|
|00000d80| 20 74 6f 20 61 74 20 6c | 65 61 73 74 20 61 73 20 | to at l|east as |
|00000d90| 6c 61 72 67 65 20 61 73 | 20 74 68 65 20 0d 20 20 |large as| the . |
|00000da0| 2f 2f 20 20 20 20 64 65 | 66 61 75 6c 74 20 73 74 |// de|fault st|
|00000db0| 61 63 6b 20 66 6f 72 20 | 74 68 65 20 6d 61 63 68 |ack for |the mach|
|00000dc0| 69 6e 65 20 28 38 4b 20 | 6f 6e 20 6d 61 63 68 69 |ine (8K |on machi|
|00000dd0| 6e 65 73 20 77 69 74 68 | 20 6f 72 69 67 69 6e 61 |nes with| origina|
|00000de0| 6c 20 51 75 69 63 6b 44 | 72 61 77 2c 20 20 0d 20 |l QuickD|raw, . |
|00000df0| 20 2f 2f 20 20 20 20 32 | 34 4b 20 6f 6e 20 6d 61 | // 2|4K on ma|
|00000e00| 63 68 69 6e 65 73 20 77 | 69 74 68 20 43 6f 6c 6f |chines w|ith Colo|
|00000e10| 72 20 51 75 69 63 6b 44 | 72 61 77 29 2c 20 73 6f |r QuickD|raw), so|
|00000e20| 20 74 68 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e | the app|lication|
|00000e30| 20 70 61 72 74 69 74 69 | 6f 6e 20 0d 20 20 2f 2f | partiti|on . //|
|00000e40| 20 20 20 20 6d 75 73 74 | 20 62 65 20 6c 61 72 67 | must| be larg|
|00000e50| 65 20 65 6e 6f 75 67 68 | 20 74 6f 20 61 63 63 6f |e enough| to acco|
|00000e60| 6d 6d 6f 64 61 74 65 20 | 61 6e 20 61 70 70 72 6f |mmodate |an appro|
|00000e70| 70 72 69 61 74 65 20 73 | 74 61 63 6b 20 61 6e 64 |priate s|tack and|
|00000e80| 20 68 65 61 70 2e 0d 20 | 20 2f 2f 20 20 20 20 0d | heap.. | // .|
|00000e90| 20 20 2f 2f 20 20 20 20 | 43 61 6c 6c 20 74 68 69 | // |Call thi|
|00000ea0| 73 20 6f 6e 6c 79 20 6f | 6e 63 65 2c 20 61 74 20 |s only o|nce, at |
|00000eb0| 74 68 65 20 62 65 67 69 | 6e 6e 69 6e 67 20 6f 66 |the begi|nning of|
|00000ec0| 20 74 68 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e | the app|lication|
|00000ed0| 2e 0d 20 20 4f 53 45 72 | 72 20 49 6e 63 72 65 61 |.. OSEr|r Increa|
|00000ee0| 73 65 41 70 70 6c 69 63 | 61 74 69 6f 6e 53 74 61 |seApplic|ationSta|
|00000ef0| 63 6b 28 53 69 7a 65 20 | 69 6e 63 72 65 6d 65 6e |ck(Size |incremen|
|00000f00| 74 53 69 7a 65 29 0d 20 | 20 7b 0d 20 20 20 20 4f |tSize). | {. O|
|00000f10| 53 45 72 72 20 72 65 74 | 43 6f 64 65 3b 0d 20 20 |SErr ret|Code;. |
|00000f20| 0d 20 20 20 20 2f 2f 20 | 49 6e 63 72 65 61 73 65 |. // |Increase|
|00000f30| 20 74 68 65 20 73 74 61 | 63 6b 20 73 69 7a 65 20 | the sta|ck size |
|00000f40| 62 79 20 6c 6f 77 65 72 | 69 6e 67 20 74 68 65 20 |by lower|ing the |
|00000f50| 68 65 61 70 20 6c 69 6d | 69 74 2e 0d 20 20 20 20 |heap lim|it.. |
|00000f60| 53 65 74 41 70 70 6c 4c | 69 6d 69 74 28 28 50 74 |SetApplL|imit((Pt|
|00000f70| 72 29 20 28 28 75 6e 73 | 69 67 6e 65 64 20 6c 6f |r) ((uns|igned lo|
|00000f80| 6e 67 29 20 47 65 74 41 | 70 70 6c 4c 69 6d 69 74 |ng) GetA|pplLimit|
|00000f90| 28 29 20 2d 20 69 6e 63 | 72 65 6d 65 6e 74 53 69 |() - inc|rementSi|
|00000fa0| 7a 65 29 29 3b 0d 20 20 | 20 20 72 65 74 43 6f 64 |ze));. | retCod|
|00000fb0| 65 20 3d 20 4d 65 6d 45 | 72 72 6f 72 28 29 3b 0d |e = MemE|rror();.|
|00000fc0| 20 20 20 20 69 66 20 28 | 72 65 74 43 6f 64 65 20 | if (|retCode |
|00000fd0| 3d 3d 20 6e 6f 45 72 72 | 29 20 4d 61 78 41 70 70 |== noErr|) MaxApp|
|00000fe0| 6c 5a 6f 6e 65 28 29 3b | 0d 20 20 0d 20 20 20 20 |lZone();|. . |
|00000ff0| 72 65 74 75 72 6e 20 72 | 65 74 43 6f 64 65 3b 0d |return r|etCode;.|
|00001000| 20 20 7d 0d 50 6f 73 74 | 69 6e 67 20 4e 6f 74 69 | }.Post|ing Noti|
|00001010| 66 69 63 61 74 69 6f 6e | 73 0d 57 68 65 6e 20 61 |fication|s.When a|
|00001020| 6e 20 65 78 63 65 70 74 | 69 6f 6e 61 6c 20 63 6f |n except|ional co|
|00001030| 6e 64 69 74 69 6f 6e 20 | 6e 65 65 64 73 20 74 6f |ndition |needs to|
|00001040| 20 62 65 20 6d 61 64 65 | 20 6b 6e 6f 77 6e 20 74 | be made| known t|
|00001050| 6f 20 74 68 65 20 75 73 | 65 72 2c 20 61 20 42 4f |o the us|er, a BO|
|00001060| 41 20 63 61 6e 20 75 73 | 65 20 74 68 65 20 4e 6f |A can us|e the No|
|00001070| 74 69 66 69 63 61 74 69 | 6f 6e 20 4d 61 6e 61 67 |tificati|on Manag|
|00001080| 65 72 20 74 6f 20 64 69 | 73 70 6c 61 79 20 61 20 |er to di|splay a |
|00001090| 73 74 72 69 6e 67 20 6f | 72 20 70 6c 61 79 20 61 |string o|r play a|
|000010a0| 20 73 6f 75 6e 64 2e 20 | 53 69 6e 63 65 20 61 20 | sound. |Since a |
|000010b0| 42 4f 41 20 69 73 20 6e | 6f 74 20 6c 69 73 74 65 |BOA is n|ot liste|
|000010c0| 64 20 69 6e 20 74 68 65 | 20 61 70 70 6c 69 63 61 |d in the| applica|
|000010d0| 74 69 6f 6e 20 6d 65 6e | 75 20 61 6e 64 20 63 61 |tion men|u and ca|
|000010e0| 6e 6e 6f 74 20 62 65 20 | 62 72 6f 75 67 68 74 20 |nnot be |brought |
|000010f0| 74 6f 20 74 68 65 20 66 | 72 6f 6e 74 20 6c 69 6b |to the f|ront lik|
|00001100| 65 20 6f 74 68 65 72 20 | 61 70 70 6c 69 63 61 74 |e other |applicat|
|00001110| 69 6f 6e 73 2c 20 74 68 | 65 20 75 73 65 72 20 6d |ions, th|e user m|
|00001120| 61 79 20 6e 6f 74 20 65 | 76 65 6e 20 6b 6e 6f 77 |ay not e|ven know|
|00001130| 20 74 68 61 74 20 69 74 | 20 69 73 20 72 75 6e 6e | that it| is runn|
|00001140| 69 6e 67 2c 20 73 6f 20 | 6e 6f 74 69 66 69 63 61 |ing, so |notifica|
|00001150| 74 69 6f 6e 73 20 63 61 | 6e 20 62 65 20 73 74 61 |tions ca|n be sta|
|00001160| 72 74 6c 69 6e 67 2e 20 | 55 73 65 20 74 68 65 20 |rtling. |Use the |
|00001170| 4e 6f 74 69 66 69 63 61 | 74 69 6f 6e 20 4d 61 6e |Notifica|tion Man|
|00001180| 61 67 65 72 20 6f 6e 6c | 79 20 74 6f 20 72 65 70 |ager onl|y to rep|
|00001190| 6f 72 74 20 61 20 73 65 | 72 69 6f 75 73 20 70 72 |ort a se|rious pr|
|000011a0| 6f 62 6c 65 6d 20 6f 72 | 20 74 6f 20 72 65 71 75 |oblem or| to requ|
|000011b0| 65 73 74 20 74 68 61 74 | 20 74 68 65 20 75 73 65 |est that| the use|
|000011c0| 72 20 74 61 6b 65 20 73 | 6f 6d 65 20 6e 65 65 64 |r take s|ome need|
|000011d0| 65 64 20 61 63 74 69 6f | 6e 2e 0d 54 68 65 20 46 |ed actio|n..The F|
|000011e0| 69 6e 64 65 72 20 61 6e | 64 20 42 4f 41 20 4c 61 |inder an|d BOA La|
|000011f0| 75 6e 63 68 69 6e 67 0d | 54 68 65 72 65 20 61 72 |unching.|There ar|
|00001200| 65 20 6e 75 6d 65 72 6f | 75 73 20 77 61 79 73 20 |e numero|us ways |
|00001210| 74 6f 20 6c 61 75 6e 63 | 68 20 61 20 42 4f 41 2e |to launc|h a BOA.|
|00001220| 20 49 66 20 61 20 42 4f | 41 20 68 61 73 20 74 68 | If a BO|A has th|
|00001230| 65 20 66 69 6c 65 20 74 | 79 70 65 20 41 50 50 4c |e file t|ype APPL|
|00001240| 2c 20 69 74 20 63 61 6e | 20 62 65 20 6f 70 65 6e |, it can| be open|
|00001250| 65 64 20 62 79 20 74 68 | 65 20 75 73 65 72 20 69 |ed by th|e user i|
|00001260| 6e 20 74 68 65 20 46 69 | 6e 64 65 72 20 6a 75 73 |n the Fi|nder jus|
|00001270| 74 20 6c 69 6b 65 20 6f | 74 68 65 72 20 61 70 70 |t like o|ther app|
|00001280| 6c 69 63 61 74 69 6f 6e | 73 2e 20 49 74 20 63 61 |lication|s. It ca|
|00001290| 6e 20 61 6c 73 6f 20 62 | 65 20 70 6c 61 63 65 64 |n also b|e placed|
|000012a0| 20 69 6e 20 74 68 65 20 | 53 74 61 72 74 75 70 20 | in the |Startup |
|000012b0| 49 74 65 6d 73 20 66 6f | 6c 64 65 72 20 75 6e 64 |Items fo|lder und|
|000012c0| 65 72 20 53 79 73 74 65 | 6d 20 37 20 66 6f 72 20 |er Syste|m 7 for |
|000012d0| 6c 61 75 6e 63 68 69 6e | 67 20 77 68 65 6e 20 74 |launchin|g when t|
|000012e0| 68 65 20 73 79 73 74 65 | 6d 20 73 74 61 72 74 73 |he syste|m starts|
|000012f0| 20 75 70 2e 0d 49 66 20 | 61 20 42 4f 41 20 68 61 | up..If |a BOA ha|
|00001300| 73 20 74 68 65 20 66 69 | 6c 65 20 74 79 70 65 20 |s the fi|le type |
|00001310| 61 70 70 65 2c 20 69 74 | 20 69 73 20 61 6e 20 61 |appe, it| is an a|
|00001320| 70 70 6c 69 63 61 74 69 | 6f 6e 20 65 78 74 65 6e |pplicati|on exten|
|00001330| 73 69 6f 6e 2e 20 49 66 | 20 74 68 65 20 75 73 65 |sion. If| the use|
|00001340| 72 20 64 72 61 67 73 20 | 61 6e 20 61 70 70 6c 69 |r drags |an appli|
|00001350| 63 61 74 69 6f 6e 20 65 | 78 74 65 6e 73 69 6f 6e |cation e|xtension|
|00001360| 20 66 69 6c 65 20 74 6f | 20 74 68 65 20 53 79 73 | file to| the Sys|
|00001370| 74 65 6d 20 66 6f 6c 64 | 65 72 2c 20 74 68 65 20 |tem fold|er, the |
|00001380| 65 78 74 65 6e 73 69 6f | 6e 20 77 69 6c 6c 20 62 |extensio|n will b|
|00001390| 65 20 72 6f 75 74 65 64 | 20 74 6f 20 74 68 65 20 |e routed| to the |
|000013a0| 45 78 74 65 6e 73 69 6f | 6e 73 20 66 6f 6c 64 65 |Extensio|ns folde|
|000013b0| 72 20 61 6e 64 20 74 68 | 65 6e 20 6c 61 75 6e 63 |r and th|en launc|
|000013c0| 68 65 64 20 77 68 65 6e | 20 74 68 65 20 73 79 73 |hed when| the sys|
|000013d0| 74 65 6d 20 73 74 61 72 | 74 73 20 75 70 2e 0d 49 |tem star|ts up..I|
|000013e0| 66 20 61 6e 20 49 4e 49 | 54 20 72 65 73 6f 75 72 |f an INI|T resour|
|000013f0| 63 65 20 69 73 20 69 6e | 20 61 6e 20 61 70 70 6c |ce is in| an appl|
|00001400| 69 63 61 74 69 6f 6e 20 | 65 78 74 65 6e 73 69 6f |ication |extensio|
|00001410| 6e 20 66 69 6c 65 20 61 | 6e 64 20 74 68 65 20 66 |n file a|nd the f|
|00001420| 69 6c 65 20 69 73 20 69 | 6e 20 74 68 65 20 45 78 |ile is i|n the Ex|
|00001430| 74 65 6e 73 69 6f 6e 73 | 20 66 6f 6c 64 65 72 2c |tensions| folder,|
|00001440| 20 74 68 65 20 73 79 73 | 74 65 6d 20 77 69 6c 6c | the sys|tem will|
|00001450| 20 65 78 65 63 75 74 65 | 20 74 68 65 20 49 4e 49 | execute| the INI|
|00001460| 54 20 63 6f 64 65 20 61 | 6c 6f 6e 67 20 77 69 74 |T code a|long wit|
|00001470| 68 20 74 68 65 20 49 4e | 49 54 73 20 6f 66 20 6f |h the IN|ITs of o|
|00001480| 74 68 65 72 20 65 78 74 | 65 6e 73 69 6f 6e 73 2e |ther ext|ensions.|
|00001490| 20 54 68 69 73 20 63 61 | 6e 20 62 65 20 75 73 65 | This ca|n be use|
|000014a0| 66 75 6c 20 66 6f 72 20 | 64 69 73 70 6c 61 79 69 |ful for |displayi|
|000014b0| 6e 67 20 61 6e 20 69 63 | 6f 6e 20 64 75 72 69 6e |ng an ic|on durin|
|000014c0| 67 20 62 6f 6f 74 69 6e | 67 2e 20 28 44 69 73 70 |g bootin|g. (Disp|
|000014d0| 6c 61 79 69 6e 67 20 61 | 6e 20 69 63 6f 6e 20 66 |laying a|n icon f|
|000014e0| 72 6f 6d 20 61 6e 20 49 | 4e 49 54 20 61 74 20 73 |rom an I|NIT at s|
|000014f0| 74 61 72 74 75 70 20 69 | 73 20 74 79 70 69 63 61 |tartup i|s typica|
|00001500| 6c 6c 79 20 64 6f 6e 65 | 20 62 79 20 75 73 69 6e |lly done| by usin|
|00001510| 67 20 74 68 65 20 53 68 | 6f 77 49 6e 69 74 20 63 |g the Sh|owInit c|
|00001520| 6f 64 65 2c 20 61 76 61 | 69 6c 61 62 6c 65 20 6f |ode, ava|ilable o|
|00001530| 6e 20 74 68 65 20 44 65 | 76 65 6c 6f 70 65 72 20 |n the De|veloper |
|00001540| 53 65 72 69 65 73 20 43 | 44 2e 29 20 53 69 6e 63 |Series C|D.) Sinc|
|00001550| 65 20 74 68 65 20 6c 61 | 75 6e 63 68 20 6f 66 20 |e the la|unch of |
|00001560| 74 68 65 20 42 4f 41 20 | 77 69 6c 6c 20 6e 6f 74 |the BOA |will not|
|00001570| 20 61 63 74 75 61 6c 6c | 79 20 6f 63 63 75 72 20 | actuall|y occur |
|00001580| 75 6e 74 69 6c 20 61 66 | 74 65 72 20 61 6c 6c 20 |until af|ter all |
|00001590| 49 4e 49 54 20 72 65 73 | 6f 75 72 63 65 73 20 68 |INIT res|ources h|
|000015a0| 61 76 65 20 62 65 65 6e | 20 72 75 6e 2c 20 61 20 |ave been| run, a |
|000015b0| 42 4f 41 d5 73 20 73 74 | 61 72 74 75 70 20 69 63 |BOA.s st|artup ic|
|000015c0| 6f 6e 20 63 61 6e 6e 6f | 74 20 62 65 20 69 6e 66 |on canno|t be inf|
|000015d0| 6f 72 6d 61 74 69 76 65 | 2e 20 46 6f 72 20 65 78 |ormative|. For ex|
|000015e0| 61 6d 70 6c 65 2c 20 74 | 68 65 20 42 4f 41 20 63 |ample, t|he BOA c|
|000015f0| 61 6e d5 74 20 64 69 73 | 70 6c 61 79 20 61 6e 20 |an.t dis|play an |
|00001600| 58 20 6f 76 65 72 20 69 | 74 73 20 69 63 6f 6e 20 |X over i|ts icon |
|00001610| 74 6f 20 69 6e 64 69 63 | 61 74 65 20 74 68 61 74 |to indic|ate that|
|00001620| 20 6c 6f 61 64 69 6e 67 | 20 68 61 73 20 66 61 69 | loading| has fai|
|00001630| 6c 65 64 2c 20 62 65 63 | 61 75 73 65 20 74 68 65 |led, bec|ause the|
|00001640| 20 42 4f 41 20 68 61 73 | 20 6e 6f 74 20 79 65 74 | BOA has| not yet|
|00001650| 20 62 65 65 6e 20 6c 61 | 75 6e 63 68 65 64 20 61 | been la|unched a|
|00001660| 74 20 49 4e 49 54 20 74 | 69 6d 65 2e 20 48 6f 77 |t INIT t|ime. How|
|00001670| 65 76 65 72 2c 20 73 68 | 6f 77 69 6e 67 20 61 6e |ever, sh|owing an|
|00001680| 20 69 63 6f 6e 20 64 75 | 72 69 6e 67 20 62 6f 6f | icon du|ring boo|
|00001690| 74 69 6e 67 20 69 73 20 | 73 74 69 6c 6c 20 75 73 |ting is |still us|
|000016a0| 65 66 75 6c 20 74 6f 20 | 72 65 6d 69 6e 64 20 75 |eful to |remind u|
|000016b0| 73 65 72 73 20 74 68 61 | 74 20 74 68 65 20 61 70 |sers tha|t the ap|
|000016c0| 70 6c 69 63 61 74 69 6f | 6e 20 65 78 74 65 6e 73 |plicatio|n extens|
|000016d0| 69 6f 6e 20 6d 61 79 20 | 62 65 20 69 6e 73 74 61 |ion may |be insta|
|000016e0| 6c 6c 65 64 20 61 6e 64 | 20 65 61 74 69 6e 67 20 |lled and| eating |
|000016f0| 75 70 20 6d 65 6d 6f 72 | 79 2e 0d 41 20 42 4f 41 |up memor|y..A BOA|
|00001700| 20 63 61 6e 20 62 65 20 | 6c 61 75 6e 63 68 65 64 | can be |launched|
|00001710| 20 77 69 74 68 20 74 68 | 65 20 50 72 6f 63 65 73 | with th|e Proces|
|00001720| 73 20 4d 61 6e 61 67 65 | 72 20 72 6f 75 74 69 6e |s Manage|r routin|
|00001730| 65 20 4c 61 75 6e 63 68 | 41 70 70 6c 69 63 61 74 |e Launch|Applicat|
|00001740| 69 6f 6e 2e 20 4c 61 75 | 6e 63 68 41 70 70 6c 69 |ion. Lau|nchAppli|
|00001750| 63 61 74 69 6f 6e 20 69 | 67 6e 6f 72 65 73 20 74 |cation i|gnores t|
|00001760| 68 65 20 74 79 70 65 20 | 6f 66 20 66 69 6c 65 73 |he type |of files|
|00001770| 20 69 74 20 69 73 20 61 | 73 6b 65 64 20 74 6f 20 | it is a|sked to |
|00001780| 6c 61 75 6e 63 68 2c 20 | 73 6f 20 74 68 65 20 42 |launch, |so the B|
|00001790| 4f 41 20 63 61 6e 20 62 | 65 20 6c 61 75 6e 63 68 |OA can b|e launch|
|000017a0| 65 64 20 77 69 74 68 20 | 4c 61 75 6e 63 68 41 70 |ed with |LaunchAp|
|000017b0| 70 6c 69 63 61 74 69 6f | 6e 20 77 68 65 74 68 65 |plicatio|n whethe|
|000017c0| 72 20 69 74 73 20 66 69 | 6c 65 20 74 79 70 65 20 |r its fi|le type |
|000017d0| 69 73 20 41 50 50 4c 2c | 20 61 70 70 65 2c 20 6f |is APPL,| appe, o|
|000017e0| 72 20 73 6f 6d 65 74 68 | 69 6e 67 20 65 6c 73 65 |r someth|ing else|
|000017f0| 2e 0d 55 6e 64 65 72 20 | 53 79 73 74 65 6d 20 37 |..Under |System 7|
|00001800| 2c 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 65 78 |, applic|ation ex|
|00001810| 74 65 6e 73 69 6f 6e 73 | 20 61 72 65 20 6c 61 75 |tensions| are lau|
|00001820| 6e 63 68 65 64 20 62 65 | 66 6f 72 65 20 74 68 65 |nched be|fore the|
|00001830| 20 46 69 6e 64 65 72 2c | 20 62 75 74 20 74 68 65 | Finder,| but the|
|00001840| 79 20 61 63 74 75 61 6c | 6c 79 20 73 74 61 72 74 |y actual|ly start|
|00001850| 20 72 75 6e 6e 69 6e 67 | 20 61 66 74 65 72 20 74 | running| after t|
|00001860| 68 65 20 46 69 6e 64 65 | 72 20 69 73 20 75 70 2e |he Finde|r is up.|
|00001870| 20 54 6f 20 75 6e 64 65 | 72 73 74 61 6e 64 20 74 | To unde|rstand t|
|00001880| 68 69 73 2c 20 72 65 6d | 65 6d 62 65 72 20 74 68 |his, rem|ember th|
|00001890| 61 74 20 61 20 63 61 6c | 6c 20 74 6f 20 4c 61 75 |at a cal|l to Lau|
|000018a0| 6e 63 68 41 70 70 6c 69 | 63 61 74 69 6f 6e 20 73 |nchAppli|cation s|
|000018b0| 69 6d 70 6c 79 20 71 75 | 65 75 65 73 20 61 20 66 |imply qu|eues a f|
|000018c0| 69 6c 65 20 66 6f 72 20 | 6c 61 74 65 72 20 6c 61 |ile for |later la|
|000018d0| 75 6e 63 68 69 6e 67 2e | 20 54 68 65 20 61 63 74 |unching.| The act|
|000018e0| 75 61 6c 20 6c 61 75 6e | 63 68 20 69 73 20 64 6f |ual laun|ch is do|
|000018f0| 6e 65 20 62 79 20 74 68 | 65 20 50 72 6f 63 65 73 |ne by th|e Proces|
|00001900| 73 20 4d 61 6e 61 67 65 | 72 20 61 74 20 74 68 65 |s Manage|r at the|
|00001910| 20 6e 65 78 74 20 63 61 | 6c 6c 20 74 6f 20 57 61 | next ca|ll to Wa|
|00001920| 69 74 4e 65 78 74 45 76 | 65 6e 74 2e 20 54 68 65 |itNextEv|ent. The|
|00001930| 20 73 79 73 74 65 6d 20 | 71 75 65 75 65 73 20 61 | system |queues a|
|00001940| 70 70 6c 69 63 61 74 69 | 6f 6e 20 65 78 74 65 6e |pplicati|on exten|
|00001950| 73 69 6f 6e 73 20 66 6f | 72 20 6c 61 75 6e 63 68 |sions fo|r launch|
|00001960| 69 6e 67 20 62 65 66 6f | 72 65 20 74 68 65 20 46 |ing befo|re the F|
|00001970| 69 6e 64 65 72 20 69 73 | 20 73 74 61 72 74 65 64 |inder is| started|
|00001980| 2e 20 54 68 65 6e 20 74 | 68 65 20 46 69 6e 64 65 |. Then t|he Finde|
|00001990| 72 20 73 74 61 72 74 73 | 20 75 70 2c 20 61 6e 64 |r starts| up, and|
|000019a0| 20 77 68 65 6e 20 74 68 | 65 20 46 69 6e 64 65 72 | when th|e Finder|
|000019b0| 20 63 61 6c 6c 73 20 57 | 61 69 74 4e 65 78 74 45 | calls W|aitNextE|
|000019c0| 76 65 6e 74 2c 20 74 68 | 65 20 42 4f 41 73 20 69 |vent, th|e BOAs i|
|000019d0| 6e 20 74 68 65 20 6c 61 | 75 6e 63 68 20 71 75 65 |n the la|unch que|
|000019e0| 75 65 20 73 74 61 72 74 | 20 72 75 6e 6e 69 6e 67 |ue start| running|
|000019f0| 2e 20 54 68 69 73 20 69 | 73 20 77 68 79 20 61 70 |. This i|s why ap|
|00001a00| 70 6c 69 63 61 74 69 6f | 6e 20 65 78 74 65 6e 73 |plicatio|n extens|
|00001a10| 69 6f 6e 73 20 68 61 76 | 65 20 6c 6f 77 65 72 20 |ions hav|e lower |
|00001a20| 70 72 6f 63 65 73 73 20 | 73 65 72 69 61 6c 20 6e |process |serial n|
|00001a30| 75 6d 62 65 72 73 20 74 | 68 61 6e 20 74 68 65 20 |umbers t|han the |
|00001a40| 46 69 6e 64 65 72 2c 20 | 65 76 65 6e 20 74 68 6f |Finder, |even tho|
|00001a50| 75 67 68 20 74 68 65 20 | 46 69 6e 64 65 72 20 69 |ugh the |Finder i|
|00001a60| 73 20 6c 6f 61 64 65 64 | 20 66 69 72 73 74 2e 0d |s loaded| first..|
|00001a70| 54 68 65 20 53 79 73 74 | 65 6d 20 37 20 46 69 6e |The Syst|em 7 Fin|
|00001a80| 64 65 72 20 69 73 20 75 | 6e 61 62 6c 65 20 74 6f |der is u|nable to|
|00001a90| 20 64 65 74 65 72 6d 69 | 6e 65 20 77 68 65 6e 20 | determi|ne when |
|00001aa0| 61 20 42 4f 41 20 73 74 | 6f 70 73 20 72 75 6e 6e |a BOA st|ops runn|
|00001ab0| 69 6e 67 2e 20 41 73 20 | 61 20 72 65 73 75 6c 74 |ing. As |a result|
|00001ac0| 2c 20 61 20 42 4f 41 20 | 69 63 6f 6e 20 74 68 61 |, a BOA |icon tha|
|00001ad0| 74 20 77 61 73 20 64 69 | 6d 6d 65 64 20 77 68 65 |t was di|mmed whe|
|00001ae0| 6e 20 74 68 65 20 75 73 | 65 72 20 6c 61 75 6e 63 |n the us|er launc|
|00001af0| 68 65 64 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 |hed the |applicat|
|00001b00| 69 6f 6e 20 62 79 20 6f | 70 65 6e 69 6e 67 20 69 |ion by o|pening i|
|00001b10| 74 20 69 6e 20 74 68 65 | 20 46 69 6e 64 65 72 20 |t in the| Finder |
|00001b20| 77 69 6c 6c 20 6e 6f 74 | 20 62 65 20 75 6e 64 69 |will not| be undi|
|00001b30| 6d 6d 65 64 20 69 66 20 | 74 68 65 20 42 4f 41 20 |mmed if |the BOA |
|00001b40| 71 75 69 74 73 2e 20 54 | 68 69 73 20 69 73 20 6a |quits. T|his is j|
|00001b50| 75 73 74 20 61 20 63 6f | 73 6d 65 74 69 63 20 70 |ust a co|smetic p|
|00001b60| 72 6f 62 6c 65 6d 2c 20 | 61 73 20 74 68 65 20 75 |roblem, |as the u|
|00001b70| 73 65 72 20 63 61 6e 20 | 72 65 6c 61 75 6e 63 68 |ser can |relaunch|
|00001b80| 20 74 68 65 20 42 4f 41 | 20 62 79 20 64 6f 75 62 | the BOA| by doub|
|00001b90| 6c 65 2d 63 6c 69 63 6b | 69 6e 67 20 74 68 65 20 |le-click|ing the |
|00001ba0| 73 74 69 6c 6c 2d 64 69 | 6d 6d 65 64 20 69 63 6f |still-di|mmed ico|
|00001bb0| 6e 2e 0d 42 4f 41 20 54 | 61 73 6b 73 0d 46 61 63 |n..BOA T|asks.Fac|
|00001bc0| 65 6c 65 73 73 20 62 61 | 63 6b 67 72 6f 75 6e 64 |eless ba|ckground|
|00001bd0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 73 20 63 61 | applica|tions ca|
|00001be0| 6e 20 64 6f 20 6d 6f 73 | 74 20 6f 66 20 74 68 65 |n do mos|t of the|
|00001bf0| 20 6a 6f 62 73 20 66 6f | 72 6d 65 72 6c 79 20 68 | jobs fo|rmerly h|
|00001c00| 61 6e 64 6c 65 64 20 62 | 79 20 73 74 61 6e 64 2d |andled b|y stand-|
|00001c10| 61 6c 6f 6e 65 20 63 6f | 64 65 20 61 6e 64 20 62 |alone co|de and b|
|00001c20| 79 20 70 65 72 69 6f 64 | 69 63 61 6c 6c 79 20 65 |y period|ically e|
|00001c30| 78 65 63 75 74 65 64 20 | 64 72 69 76 65 72 73 2e |xecuted |drivers.|
|00001c40| 20 54 68 65 20 70 72 69 | 6d 61 72 79 20 72 65 61 | The pri|mary rea|
|00001c50| 73 6f 6e 20 74 6f 20 75 | 73 65 20 61 6e 20 49 4e |son to u|se an IN|
|00001c60| 49 54 20 69 6e 73 74 65 | 61 64 20 6f 66 20 61 20 |IT inste|ad of a |
|00001c70| 42 4f 41 20 69 73 20 74 | 6f 20 6d 61 6b 65 20 67 |BOA is t|o make g|
|00001c80| 6c 6f 62 61 6c 20 74 72 | 61 70 20 70 61 74 63 68 |lobal tr|ap patch|
|00001c90| 65 73 2e 20 42 65 63 61 | 75 73 65 20 61 20 42 4f |es. Beca|use a BO|
|00001ca0| 41 20 69 73 20 61 6e 20 | 61 70 70 6c 69 63 61 74 |A is an |applicat|
|00001cb0| 69 6f 6e 2c 20 61 20 74 | 72 61 70 20 61 64 64 72 |ion, a t|rap addr|
|00001cc0| 65 73 73 20 73 65 74 20 | 66 72 6f 6d 20 77 69 74 |ess set |from wit|
|00001cd0| 68 69 6e 20 74 68 65 20 | 42 4f 41 20 77 69 6c 6c |hin the |BOA will|
|00001ce0| 20 61 70 70 6c 79 20 6f | 6e 6c 79 20 74 6f 20 74 | apply o|nly to t|
|00001cf0| 68 65 20 42 4f 41 2c 20 | 6e 6f 74 20 67 6c 6f 62 |he BOA, |not glob|
|00001d00| 61 6c 6c 79 2e 0d 41 20 | 42 4f 41 20 63 61 6e 20 |ally..A |BOA can |
|00001d10| 6e 6f 74 20 65 76 65 72 | 20 65 78 70 6c 69 63 69 |not ever| explici|
|00001d20| 74 6c 79 20 64 72 61 77 | 20 6f 6e 20 74 68 65 20 |tly draw| on the |
|00001d30| 73 63 72 65 65 6e 2e 20 | 57 68 69 6c 65 20 73 61 |screen. |While sa|
|00001d40| 66 65 6c 79 20 63 72 65 | 61 74 69 6e 67 20 61 6e |fely cre|ating an|
|00001d50| 64 20 69 6e 69 74 69 61 | 6c 69 7a 69 6e 67 20 61 |d initia|lizing a|
|00001d60| 6e 20 61 70 70 72 6f 70 | 72 69 61 74 65 20 77 6f |n approp|riate wo|
|00001d70| 72 6c 64 20 66 6f 72 20 | 64 72 61 77 69 6e 67 20 |rld for |drawing |
|00001d80| 66 72 6f 6d 20 73 74 61 | 6e 64 2d 61 6c 6f 6e 65 |from sta|nd-alone|
|00001d90| 20 63 6f 64 65 20 28 74 | 79 70 69 63 61 6c 6c 79 | code (t|ypically|
|00001da0| 20 66 72 6f 6d 20 61 6e | 20 49 4e 49 54 29 20 69 | from an| INIT) i|
|00001db0| 73 20 71 75 69 74 65 20 | 64 69 66 66 69 63 75 6c |s quite |difficul|
|00001dc0| 74 2c 20 69 74 20 63 61 | 6e 20 62 65 20 64 6f 6e |t, it ca|n be don|
|00001dd0| 65 2e 20 49 66 20 61 6e | 79 20 64 72 61 77 69 6e |e. If an|y drawin|
|00001de0| 67 20 77 69 6c 6c 20 62 | 65 20 6e 65 63 65 73 73 |g will b|e necess|
|00001df0| 61 72 79 2c 20 64 6f 20 | 6e 6f 74 20 75 73 65 20 |ary, do |not use |
|00001e00| 61 20 42 4f 41 2e 0d 49 | 74 20 69 73 20 73 61 66 |a BOA..I|t is saf|
|00001e10| 65 20 61 6e 64 20 61 70 | 70 72 6f 70 72 69 61 74 |e and ap|propriat|
|00001e20| 65 20 74 6f 20 73 74 6f | 72 65 20 69 6e 74 65 72 |e to sto|re inter|
|00001e30| 72 75 70 74 20 72 6f 75 | 74 69 6e 65 73 20 77 69 |rupt rou|tines wi|
|00001e40| 74 68 69 6e 20 74 68 65 | 20 68 65 61 70 20 6f 66 |thin the| heap of|
|00001e50| 20 61 20 42 4f 41 2e 20 | 46 6f 72 20 65 78 61 6d | a BOA. |For exam|
|00001e60| 70 6c 65 2c 20 61 20 54 | 69 6d 65 20 4d 61 6e 61 |ple, a T|ime Mana|
|00001e70| 67 65 72 20 74 61 73 6b | d5 73 20 63 6f 64 65 20 |ger task|.s code |
|00001e80| 6f 72 20 61 20 63 6f 6d | 70 6c 65 74 69 6f 6e 20 |or a com|pletion |
|00001e90| 72 6f 75 74 69 6e 65 20 | 6d 61 79 20 61 63 74 75 |routine |may actu|
|00001ea0| 61 6c 6c 79 20 62 65 20 | 61 20 70 72 6f 63 65 64 |ally be |a proced|
|00001eb0| 75 72 65 20 6f 66 20 61 | 20 42 4f 41 2e 20 53 69 |ure of a| BOA. Si|
|00001ec0| 6e 63 65 20 61 6c 6c 20 | 6f 66 20 69 74 73 20 68 |nce all |of its h|
|00001ed0| 65 61 70 20 73 70 61 63 | 65 20 69 73 20 72 65 6c |eap spac|e is rel|
|00001ee0| 65 61 73 65 64 20 6f 6e | 63 65 20 61 20 42 4f 41 |eased on|ce a BOA|
|00001ef0| 20 71 75 69 74 73 2c 20 | 61 20 42 4f 41 20 6d 75 | quits, |a BOA mu|
|00001f00| 73 74 20 6e 6f 74 20 71 | 75 69 74 20 77 68 69 6c |st not q|uit whil|
|00001f10| 65 20 61 6e 79 20 69 6e | 74 65 72 72 75 70 74 20 |e any in|terrupt |
|00001f20| 6f 72 20 63 6f 6d 70 6c | 65 74 69 6f 6e 20 72 6f |or compl|etion ro|
|00001f30| 75 74 69 6e 65 73 20 61 | 72 65 20 70 65 6e 64 69 |utines a|re pendi|
|00001f40| 6e 67 2e 20 41 20 42 4f | 41 20 6d 61 79 20 62 65 |ng. A BO|A may be|
|00001f50| 20 70 75 74 20 74 6f 20 | 73 6c 65 65 70 20 28 62 | put to |sleep (b|
|00001f60| 79 20 70 61 73 73 69 6e | 67 20 61 20 6c 61 72 67 |y passin|g a larg|
|00001f70| 65 20 73 6c 65 65 70 20 | 70 61 72 61 6d 65 74 65 |e sleep |paramete|
|00001f80| 72 20 74 6f 20 57 61 69 | 74 4e 65 78 74 45 76 65 |r to Wai|tNextEve|
|00001f90| 6e 74 29 20 61 6e 64 2c | 20 75 6e 64 65 72 20 53 |nt) and,| under S|
|00001fa0| 79 73 74 65 6d 20 37 2c | 20 6c 61 74 65 72 20 77 |ystem 7,| later w|
|00001fb0| 6f 6b 65 6e 20 75 70 20 | 61 74 20 69 6e 74 65 72 |oken up |at inter|
|00001fc0| 72 75 70 74 20 74 69 6d | 65 20 77 69 74 68 20 61 |rupt tim|e with a|
|00001fd0| 20 63 61 6c 6c 20 74 6f | 20 57 61 6b 65 55 70 50 | call to| WakeUpP|
|00001fe0| 72 6f 63 65 73 73 2e 0d | 41 6e 79 20 61 70 70 6c |rocess..|Any appl|
|00001ff0| 69 63 61 74 69 6f 6e 20 | 74 68 61 74 20 69 73 20 |ication |that is |
|00002000| 6e 6f 74 20 70 65 72 66 | 6f 72 6d 69 6e 67 20 61 |not perf|orming a|
|00002010| 20 70 65 72 69 6f 64 69 | 63 20 74 61 73 6b 20 73 | periodi|c task s|
|00002020| 68 6f 75 6c 64 20 75 73 | 65 20 61 20 6c 61 72 67 |hould us|e a larg|
|00002030| 65 20 73 6c 65 65 70 20 | 76 61 6c 75 65 20 69 6e |e sleep |value in|
|00002040| 20 69 74 73 20 63 61 6c | 6c 73 20 74 6f 20 57 61 | its cal|ls to Wa|
|00002050| 69 74 4e 65 78 74 45 76 | 65 6e 74 2e 20 53 69 6e |itNextEv|ent. Sin|
|00002060| 63 65 20 61 6e 20 61 70 | 70 6c 69 63 61 74 69 6f |ce an ap|plicatio|
|00002070| 6e 20 69 73 20 77 6f 6b | 65 6e 20 75 70 20 77 68 |n is wok|en up wh|
|00002080| 65 6e 65 76 65 72 20 61 | 6e 79 20 65 76 65 6e 74 |enever a|ny event|
|00002090| 73 20 61 72 65 20 70 65 | 6e 64 69 6e 67 20 66 6f |s are pe|nding fo|
|000020a0| 72 20 69 74 2c 20 75 73 | 69 6e 67 20 6c 61 72 67 |r it, us|ing larg|
|000020b0| 65 20 73 6c 65 65 70 20 | 76 61 6c 75 65 73 20 77 |e sleep |values w|
|000020c0| 69 6c 6c 20 68 65 6c 70 | 20 61 76 6f 69 64 20 73 |ill help| avoid s|
|000020d0| 6c 6f 77 69 6e 67 20 64 | 6f 77 6e 20 74 68 65 20 |lowing d|own the |
|000020e0| 65 78 65 63 75 74 69 6f | 6e 20 6f 66 20 6f 74 68 |executio|n of oth|
|000020f0| 65 72 20 70 72 6f 63 65 | 73 73 65 73 20 77 69 74 |er proce|sses wit|
|00002100| 68 6f 75 74 20 68 75 72 | 74 69 6e 67 20 74 68 65 |hout hur|ting the|
|00002110| 20 73 6c 65 65 70 69 6e | 67 20 70 72 6f 63 65 73 | sleepin|g proces|
|00002120| 73 d5 73 20 72 65 73 70 | 6f 6e 73 69 76 65 6e 65 |s.s resp|onsivene|
|00002130| 73 73 2e 20 41 20 62 61 | 63 6b 67 72 6f 75 6e 64 |ss. A ba|ckground|
|00002140| 2d 6f 6e 6c 79 20 61 70 | 70 6c 69 63 61 74 69 6f |-only ap|plicatio|
|00002150| 6e 20 63 61 6e 20 72 75 | 6e 20 70 65 72 69 6f 64 |n can ru|n period|
|00002160| 69 63 61 6c 6c 79 20 28 | 61 73 20 61 20 64 61 65 |ically (|as a dae|
|00002170| 6d 6f 6e 29 20 62 79 20 | 70 61 73 73 69 6e 67 20 |mon) by |passing |
|00002180| 61 6e 20 61 70 70 72 6f | 70 72 69 61 74 65 6c 79 |an appro|priately|
|00002190| 20 73 6d 61 6c 6c 20 73 | 6c 65 65 70 20 76 61 6c | small s|leep val|
|000021a0| 75 65 20 74 6f 20 57 61 | 69 74 4e 65 78 74 45 76 |ue to Wa|itNextEv|
|000021b0| 65 6e 74 2e 0d 42 61 63 | 6b 67 72 6f 75 6e 64 20 |ent..Bac|kground |
|000021c0| 41 70 70 6c 65 20 45 76 | 65 6e 74 73 0d 41 6c 74 |Apple Ev|ents.Alt|
|000021d0| 68 6f 75 67 68 20 41 70 | 70 6c 65 20 65 76 65 6e |hough Ap|ple even|
|000021e0| 74 73 20 61 72 65 20 61 | 6e 20 65 78 63 65 6c 6c |ts are a|n excell|
|000021f0| 65 6e 74 20 6d 65 64 69 | 75 6d 20 66 6f 72 20 63 |ent medi|um for c|
|00002200| 6f 6d 6d 75 6e 69 63 61 | 74 69 6f 6e 20 62 65 74 |ommunica|tion bet|
|00002210| 77 65 65 6e 20 61 20 42 | 4f 41 20 61 6e 64 20 6f |ween a B|OA and o|
|00002220| 74 68 65 72 20 70 72 6f | 63 65 73 73 65 73 2c 20 |ther pro|cesses, |
|00002230| 62 65 20 63 61 72 65 66 | 75 6c 20 74 6f 20 61 76 |be caref|ul to av|
|00002240| 6f 69 64 20 73 69 74 75 | 61 74 69 6f 6e 73 20 74 |oid situ|ations t|
|00002250| 68 61 74 20 6d 61 79 20 | 72 65 71 75 69 72 65 20 |hat may |require |
|00002260| 75 73 65 72 20 69 6e 74 | 65 72 61 63 74 69 6f 6e |user int|eraction|
|00002270| 2e 20 46 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 61 |. For ex|ample, a|
|00002280| 74 74 65 6d 70 74 69 6e | 67 20 74 6f 20 74 61 72 |ttemptin|g to tar|
|00002290| 67 65 74 20 61 20 70 72 | 6f 63 65 73 73 20 6f 6e |get a pr|ocess on|
|000022a0| 20 61 6e 6f 74 68 65 72 | 20 6d 61 63 68 69 6e 65 | another| machine|
|000022b0| 20 66 6f 72 20 77 68 69 | 63 68 20 74 68 65 72 65 | for whi|ch there|
|000022c0| 20 69 73 20 6e 6f 20 63 | 75 72 72 65 6e 74 20 73 | is no c|urrent s|
|000022d0| 65 73 73 69 6f 6e 20 77 | 6f 75 6c 64 20 72 61 69 |ession w|ould rai|
|000022e0| 73 65 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 6c |se the p|rogram l|
|000022f0| 69 6e 6b 69 6e 67 20 64 | 69 61 6c 6f 67 2e 20 41 |inking d|ialog. A|
|00002300| 20 42 4f 41 20 63 61 6e | 20 75 73 75 61 6c 6c 79 | BOA can| usually|
|00002310| 20 61 76 6f 69 64 20 74 | 68 6f 73 65 20 73 69 74 | avoid t|hose sit|
|00002320| 75 61 74 69 6f 6e 73 20 | 62 79 20 68 61 6e 64 6c |uations |by handl|
|00002330| 69 6e 67 20 41 70 70 6c | 65 20 65 76 65 6e 74 73 |ing Appl|e events|
|00002340| 20 61 6e 64 20 72 65 73 | 70 6f 6e 64 69 6e 67 20 | and res|ponding |
|00002350| 77 69 74 68 20 74 68 65 | 20 72 65 70 6c 79 20 65 |with the| reply e|
|00002360| 76 65 6e 74 2c 20 6f 72 | 20 62 79 20 73 61 76 69 |vent, or| by savi|
|00002370| 6e 67 20 74 68 65 20 61 | 64 64 72 65 73 73 20 6f |ng the a|ddress o|
|00002380| 66 20 61 6e 20 65 76 65 | 6e 74 20 73 65 6e 64 65 |f an eve|nt sende|
|00002390| 72 20 28 62 79 20 63 61 | 6c 6c 69 6e 67 20 41 45 |r (by ca|lling AE|
|000023a0| 47 65 74 41 74 74 72 69 | 62 75 74 65 50 74 72 20 |GetAttri|butePtr |
|000023b0| 74 6f 20 65 78 74 72 61 | 63 74 20 74 68 65 20 6b |to extra|ct the k|
|000023c0| 65 79 41 64 64 72 65 73 | 73 41 74 74 72 20 61 74 |eyAddres|sAttr at|
|000023d0| 74 72 69 62 75 74 65 20 | 6f 66 20 61 6e 20 41 70 |tribute |of an Ap|
|000023e0| 70 6c 65 20 65 76 65 6e | 74 20 73 65 6e 74 20 74 |ple even|t sent t|
|000023f0| 6f 20 74 68 65 20 42 4f | 41 29 20 61 6e 64 20 75 |o the BO|A) and u|
|00002400| 73 69 6e 67 20 69 74 20 | 6c 61 74 65 72 20 74 6f |sing it |later to|
|00002410| 20 74 61 72 67 65 74 20 | 61 20 72 65 73 70 6f 6e | target |a respon|
|00002420| 73 65 2e 0d 46 75 72 74 | 68 65 72 20 52 65 66 65 |se..Furt|her Refe|
|00002430| 72 65 6e 63 65 3a 0d a5 | 09 49 6e 73 69 64 65 20 |rence:..|.Inside |
|00002440| 4d 61 63 69 6e 74 6f 73 | 68 2c 20 56 6f 6c 75 6d |Macintos|h, Volum|
|00002450| 65 20 56 49 2c 20 45 76 | 65 6e 74 20 4d 61 6e 61 |e VI, Ev|ent Mana|
|00002460| 67 65 72 2c 20 50 72 6f | 63 65 73 73 20 4d 61 6e |ger, Pro|cess Man|
|00002470| 61 67 65 6d 65 6e 74 2c | 20 46 69 6e 64 65 72 20 |agement,| Finder |
|00002480| 49 6e 74 65 72 66 61 63 | 65 2c 20 61 6e 64 20 41 |Interfac|e, and A|
|00002490| 70 70 6c 65 20 45 76 65 | 6e 74 73 20 63 68 61 70 |pple Eve|nts chap|
|000024a0| 74 65 72 73 0d a5 09 d2 | 42 65 20 4f 75 72 20 47 |ters....|Be Our G|
|000024b0| 75 65 73 74 3a 20 42 61 | 63 6b 67 72 6f 75 6e 64 |uest: Ba|ckground|
|000024c0| 2d 4f 6e 6c 79 20 41 70 | 70 6c 69 63 61 74 69 6f |-Only Ap|plicatio|
|000024d0| 6e 73 20 69 6e 20 53 79 | 73 74 65 6d 20 37 d3 20 |ns in Sy|stem 7. |
|000024e0| 69 6e 20 69 73 73 75 65 | 20 39 20 6f 66 20 64 65 |in issue| 9 of de|
|000024f0| 76 65 6c 6f 70 20 69 6e | 74 72 6f 64 75 63 65 73 |velop in|troduces|
|00002500| 20 42 4f 41 73 2e 20 0d | a5 09 4d 61 63 69 6e 74 | BOAs. .|..Macint|
|00002510| 6f 73 68 20 54 65 63 68 | 6e 69 63 61 6c 20 4e 6f |osh Tech|nical No|
|00002520| 74 65 20 4d 2e 50 54 2e | 53 74 61 6e 64 41 6c 6f |te M.PT.|StandAlo|
|00002530| 6e 65 43 6f 64 65 20 d2 | 53 74 61 6e 64 2d 61 6c |neCode .|Stand-al|
|00002540| 6f 6e 65 20 63 6f 64 65 | 2c 20 61 64 20 6e 61 75 |one code|, ad nau|
|00002550| 73 65 61 6d d3 20 28 66 | 6f 72 6d 65 72 6c 79 20 |seam. (f|ormerly |
|00002560| 23 32 35 36 29 20 64 69 | 73 63 75 73 73 65 73 20 |#256) di|scusses |
|00002570| 72 65 71 75 69 72 65 6d | 65 6e 74 73 20 66 6f 72 |requirem|ents for|
|00002580| 20 49 4e 49 54 73 2e 0d | 44 65 66 65 72 72 65 64 | INITs..|Deferred|
|00002590| 20 54 61 73 6b 20 54 72 | 61 70 73 2c 20 54 72 75 | Task Tr|aps, Tru|
|000025a0| 74 68 73 2c 20 61 6e 64 | 20 54 69 70 73 0d 50 72 |ths, and| Tips.Pr|
|000025b0| 6f 63 65 73 73 65 73 09 | 4d 2e 50 53 2e 44 65 66 |ocesses.|M.PS.Def|
|000025c0| 65 72 72 65 64 54 61 73 | 6b 73 0d 57 72 69 74 74 |erredTas|ks.Writt|
|000025d0| 65 6e 20 62 79 3a 09 4a | 69 6d 20 4c 75 74 68 65 |en by:.J|im Luthe|
|000025e0| 72 09 4a 75 6c 79 20 31 | 39 39 32 0d 54 68 69 73 |r.July 1|992.This|
|000025f0| 20 54 65 63 68 6e 69 63 | 61 6c 20 4e 6f 74 65 20 | Technic|al Note |
|00002600| 73 68 6f 77 73 20 68 6f | 77 20 74 6f 20 64 65 74 |shows ho|w to det|
|00002610| 65 72 6d 69 6e 65 20 77 | 68 65 6e 20 74 68 65 20 |ermine w|hen the |
|00002620| 44 65 66 65 72 72 65 64 | 20 54 61 73 6b 20 4d 61 |Deferred| Task Ma|
|00002630| 6e 61 67 65 72 20 69 73 | 20 61 76 61 69 6c 61 62 |nager is| availab|
|00002640| 6c 65 2c 20 70 6f 69 6e | 74 73 20 6f 75 74 20 61 |le, poin|ts out a|
|00002650| 20 63 6f 6d 70 61 74 69 | 62 69 6c 69 74 79 20 69 | compati|bility i|
|00002660| 73 73 75 65 20 77 69 74 | 68 20 74 68 65 20 4d 61 |ssue wit|h the Ma|
|00002670| 63 69 6e 74 6f 73 68 20 | 50 6c 75 73 2c 20 65 78 |cintosh |Plus, ex|
|00002680| 70 6c 61 69 6e 73 20 68 | 6f 77 20 61 6e 64 20 77 |plains h|ow and w|
|00002690| 68 65 6e 20 64 65 66 65 | 72 72 65 64 20 74 61 73 |hen defe|rred tas|
|000026a0| 6b 73 20 61 72 65 20 63 | 61 6c 6c 65 64 2c 20 61 |ks are c|alled, a|
|000026b0| 6e 64 20 73 68 6f 77 73 | 20 68 6f 77 20 74 6f 20 |nd shows| how to |
|000026c0| 61 63 63 65 73 73 20 74 | 68 65 20 64 74 50 61 72 |access t|he dtPar|
|000026d0| 6d 20 70 61 72 61 6d 65 | 74 65 72 20 66 72 6f 6d |m parame|ter from|
|000026e0| 20 64 65 66 65 72 72 65 | 64 20 74 61 73 6b 73 20 | deferre|d tasks |
|000026f0| 77 72 69 74 74 65 6e 20 | 69 6e 20 43 20 61 6e 64 |written |in C and|
|00002700| 20 50 61 73 63 61 6c 2e | 0d 43 6f 6e 74 72 61 72 | Pascal.|.Contrar|
|00002710| 79 20 74 6f 20 61 20 62 | 65 6c 69 65 66 20 73 74 |y to a b|elief st|
|00002720| 61 72 74 65 64 20 62 79 | 20 61 20 52 65 61 64 65 |arted by| a Reade|
|00002730| 72 d5 73 20 47 75 69 64 | 65 20 6e 6f 74 65 20 69 |r.s Guid|e note i|
|00002740| 6e 20 49 6e 73 69 64 65 | 20 4d 61 63 69 6e 74 6f |n Inside| Macinto|
|00002750| 73 68 2c 20 74 68 65 20 | 44 65 66 65 72 72 65 64 |sh, the |Deferred|
|00002760| 20 54 61 73 6b 20 4d 61 | 6e 61 67 65 72 20 69 73 | Task Ma|nager is|
|00002770| 20 75 73 65 66 75 6c 20 | 66 6f 72 20 61 6c 6c 20 | useful |for all |
|00002780| 6c 65 6e 67 74 68 79 20 | 69 6e 74 65 72 72 75 70 |lengthy |interrup|
|00002790| 74 20 74 69 6d 65 20 74 | 61 73 6b 73 2c 20 65 76 |t time t|asks, ev|
|000027a0| 65 6e 20 74 68 6f 73 65 | 20 6e 6f 74 20 69 6e 69 |en those| not ini|
|000027b0| 74 69 61 74 65 64 20 62 | 79 20 73 6c 6f 74 20 63 |tiated b|y slot c|
|000027c0| 61 72 64 73 2e 20 20 44 | 65 66 65 72 72 69 6e 67 |ards. D|eferring|
|000027d0| 20 61 20 74 61 73 6b 20 | 69 73 20 75 73 65 66 75 | a task |is usefu|
|000027e0| 6c 20 61 6e 79 74 69 6d | 65 20 69 6e 74 65 72 72 |l anytim|e interr|
|000027f0| 75 70 74 20 74 69 6d 65 | 20 63 6f 64 65 20 28 74 |upt time| code (t|
|00002800| 68 61 74 20 69 6e 63 6c | 75 64 65 73 20 63 6f 6d |hat incl|udes com|
|00002810| 70 6c 65 74 69 6f 6e 20 | 72 6f 75 74 69 6e 65 73 |pletion |routines|
|00002820| 2c 20 54 69 6d 65 20 4d | 61 6e 61 67 65 72 20 74 |, Time M|anager t|
|00002830| 61 73 6b 73 2c 20 65 74 | 63 2e 29 20 69 73 20 67 |asks, et|c.) is g|
|00002840| 6f 69 6e 67 20 74 6f 20 | 70 65 72 66 6f 72 6d 20 |oing to |perform |
|00002850| 61 20 6c 65 6e 67 74 68 | 79 20 74 61 73 6b 20 74 |a length|y task t|
|00002860| 68 61 74 20 63 61 6e 20 | 62 65 20 61 63 63 6f 6d |hat can |be accom|
|00002870| 70 6c 69 73 68 65 64 20 | 77 69 74 68 20 69 6e 74 |plished |with int|
|00002880| 65 72 72 75 70 74 73 20 | 65 6e 61 62 6c 65 64 20 |errupts |enabled |
|00002890| 28 70 72 6f 63 65 73 73 | 6f 72 20 70 72 69 6f 72 |(process|or prior|
|000028a0| 69 74 79 20 6c 65 76 65 | 6c 20 30 29 2e 20 20 54 |ity leve|l 0). T|
|000028b0| 68 69 73 20 6e 6f 74 65 | 20 63 6f 6e 74 61 69 6e |his note| contain|
|000028c0| 73 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 62 65 |s inform|ation be|
|000028d0| 79 6f 6e 64 20 74 68 61 | 74 20 69 6e 63 6c 75 64 |yond tha|t includ|
|000028e0| 65 64 20 69 6e 20 49 6e | 73 69 64 65 20 4d 61 63 |ed in In|side Mac|
|000028f0| 69 6e 74 6f 73 68 20 74 | 68 61 74 20 79 6f 75 20 |intosh t|hat you |
|00002900| 6d 61 79 20 66 69 6e 64 | 20 75 73 65 66 75 6c 20 |may find| useful |
|00002910| 77 68 65 6e 20 75 73 69 | 6e 67 20 64 65 66 65 72 |when usi|ng defer|
|00002920| 72 65 64 20 74 61 73 6b | 73 2e 0d 57 68 65 6e 20 |red task|s..When |
|00002930| 79 6f 75 20 63 61 6e 20 | 75 73 65 20 74 68 65 20 |you can |use the |
|00002940| 44 65 66 65 72 72 65 64 | 20 54 61 73 6b 20 4d 61 |Deferred| Task Ma|
|00002950| 6e 61 67 65 72 0d 41 70 | 70 6c 69 63 61 74 69 6f |nager.Ap|plicatio|
|00002960| 6e 73 20 63 61 6e 6e 6f | 74 20 61 6c 77 61 79 73 |ns canno|t always|
|00002970| 20 64 65 70 65 6e 64 20 | 6f 6e 20 68 61 76 69 6e | depend |on havin|
|00002980| 67 20 74 68 65 20 73 65 | 72 76 69 63 65 73 20 6f |g the se|rvices o|
|00002990| 66 20 74 68 65 20 44 65 | 66 65 72 72 65 64 20 54 |f the De|ferred T|
|000029a0| 61 73 6b 20 4d 61 6e 61 | 67 65 72 2e 20 20 49 6e |ask Mana|ger. In|
|000029b0| 20 70 61 72 74 69 63 75 | 6c 61 72 2c 20 74 68 65 | particu|lar, the|
|000029c0| 20 44 65 66 65 72 72 65 | 64 20 54 61 73 6b 20 4d | Deferre|d Task M|
|000029d0| 61 6e 61 67 65 72 20 69 | 73 20 6e 6f 74 20 61 76 |anager i|s not av|
|000029e0| 61 69 6c 61 62 6c 65 20 | 6f 6e 20 74 68 65 20 4d |ailable |on the M|
|000029f0| 61 63 69 6e 74 6f 73 68 | 20 50 6c 75 73 20 61 6e |acintosh| Plus an|
|00002a00| 64 20 4d 61 63 69 6e 74 | 6f 73 68 20 53 45 20 72 |d Macint|osh SE r|
|00002a10| 75 6e 6e 69 6e 67 20 4d | 61 63 69 6e 74 6f 73 68 |unning M|acintosh|
|00002a20| 20 53 79 73 74 65 6d 20 | 36 2e 20 20 54 68 65 72 | System |6. Ther|
|00002a30| 65 20 69 73 20 61 6c 73 | 6f 20 6e 6f 20 73 75 70 |e is als|o no sup|
|00002a40| 70 6f 72 74 20 66 6f 72 | 20 74 68 65 20 44 65 66 |port for| the Def|
|00002a50| 65 72 72 65 64 20 54 61 | 73 6b 20 4d 61 6e 61 67 |erred Ta|sk Manag|
|00002a60| 65 72 20 69 6e 20 76 65 | 72 73 69 6f 6e 73 20 6f |er in ve|rsions o|
|00002a70| 66 20 41 2f 55 58 20 20 | 70 72 69 6f 72 20 74 6f |f A/UX |prior to|
|00002a80| 20 76 65 72 73 69 6f 6e | 20 33 2e 30 2e 20 20 4d | version| 3.0. M|
|00002a90| 61 63 69 6e 74 6f 73 68 | 20 53 79 73 74 65 6d 20 |acintosh| System |
|00002aa0| 37 20 61 64 64 73 20 74 | 68 65 20 44 65 66 65 72 |7 adds t|he Defer|
|00002ab0| 72 65 64 20 54 61 73 6b | 20 4d 61 6e 61 67 65 72 |red Task| Manager|
|00002ac0| 20 74 6f 20 74 68 65 20 | 4d 61 63 69 6e 74 6f 73 | to the |Macintos|
|00002ad0| 68 20 50 6c 75 73 20 61 | 6e 64 20 4d 61 63 69 6e |h Plus a|nd Macin|
|00002ae0| 74 6f 73 68 20 53 45 2e | 0d 59 6f 75 20 73 68 6f |tosh SE.|.You sho|
|00002af0| 75 6c 64 20 61 6c 77 61 | 79 73 20 63 68 65 63 6b |uld alwa|ys check|
|00002b00| 20 74 6f 20 6d 61 6b 65 | 20 73 75 72 65 20 74 68 | to make| sure th|
|00002b10| 65 20 44 65 66 65 72 72 | 65 64 20 54 61 73 6b 20 |e Deferr|ed Task |
|00002b20| 4d 61 6e 61 67 65 72 20 | 69 73 20 61 76 61 69 6c |Manager |is avail|
|00002b30| 61 62 6c 65 20 77 69 74 | 68 20 74 68 65 20 66 6f |able wit|h the fo|
|00002b40| 6c 6c 6f 77 69 6e 67 20 | 63 6f 64 65 20 77 68 69 |llowing |code whi|
|00002b50| 63 68 20 63 68 65 63 6b | 73 20 66 6f 72 20 74 68 |ch check|s for th|
|00002b60| 65 20 65 78 69 73 74 65 | 6e 63 65 20 6f 66 20 74 |e existe|nce of t|
|00002b70| 68 65 20 5f 44 54 49 6e | 73 74 61 6c 6c 20 74 72 |he _DTIn|stall tr|
|00002b80| 61 70 2e 0d 49 6e 20 50 | 61 73 63 61 6c 3a 0d 20 |ap..In P|ascal:. |
|00002b90| 20 20 20 67 48 61 73 44 | 65 66 65 72 72 65 64 54 | gHasD|eferredT|
|00002ba0| 61 73 6b 73 20 3a 3d 20 | 54 72 61 70 41 76 61 69 |asks := |TrapAvai|
|00002bb0| 6c 61 62 6c 65 28 5f 44 | 54 49 6e 73 74 61 6c 6c |lable(_D|TInstall|
|00002bc0| 29 3b 0d 20 20 20 20 7b | 73 65 65 20 49 6e 73 69 |);. {|see Insi|
|00002bd0| 64 65 20 4d 61 63 69 6e | 74 6f 73 68 20 56 6f 6c |de Macin|tosh Vol|
|00002be0| 75 6d 65 20 56 49 20 43 | 68 61 70 74 65 72 20 33 |ume VI C|hapter 3|
|00002bf0| 20 66 6f 72 20 54 72 61 | 70 41 76 61 69 6c 61 62 | for Tra|pAvailab|
|00002c00| 6c 65 20 66 75 6e 63 74 | 69 6f 6e 20 7d 0d 49 6e |le funct|ion }.In|
|00002c10| 20 43 3a 0d 20 20 20 20 | 67 48 61 73 44 65 66 65 | C:. |gHasDefe|
|00002c20| 72 72 65 64 54 61 73 6b | 73 20 3d 20 54 72 61 70 |rredTask|s = Trap|
|00002c30| 41 76 61 69 6c 61 62 6c | 65 28 5f 44 54 49 6e 73 |Availabl|e(_DTIns|
|00002c40| 74 61 6c 6c 29 3b 0d 20 | 20 20 20 7b 73 65 65 20 |tall);. | {see |
|00002c50| 49 6e 73 69 64 65 20 4d | 61 63 69 6e 74 6f 73 68 |Inside M|acintosh|
|00002c60| 20 56 6f 6c 75 6d 65 20 | 56 49 20 43 68 61 70 74 | Volume |VI Chapt|
|00002c70| 65 72 20 33 20 66 6f 72 | 20 54 72 61 70 41 76 61 |er 3 for| TrapAva|
|00002c80| 69 6c 61 62 6c 65 20 66 | 75 6e 63 74 69 6f 6e 20 |ilable f|unction |
|00002c90| 7d 0d 44 65 66 65 72 72 | 65 64 20 54 61 73 6b 73 |}.Deferr|ed Tasks|
|00002ca0| 20 6f 6e 20 74 68 65 20 | 4d 61 63 69 6e 74 6f 73 | on the |Macintos|
|00002cb0| 68 20 50 6c 75 73 0d 41 | 73 20 74 68 65 20 63 6f |h Plus.A|s the co|
|00002cc0| 6d 70 61 74 69 62 69 6c | 69 74 79 20 63 68 61 70 |mpatibil|ity chap|
|00002cd0| 74 65 72 20 6f 66 20 49 | 6e 73 69 64 65 20 4d 61 |ter of I|nside Ma|
|00002ce0| 63 69 6e 74 6f 73 68 20 | 56 6f 6c 75 6d 65 20 56 |cintosh |Volume V|
|00002cf0| 49 20 61 64 76 69 73 65 | 73 2c 20 d2 c9 79 6f 75 |I advise|s, ..you|
|00002d00| 20 73 68 6f 75 6c 64 20 | 74 72 79 20 74 6f 20 61 | should |try to a|
|00002d10| 76 6f 69 64 20 65 76 65 | 6e 20 77 65 6c 6c 2d 6b |void eve|n well-k|
|00002d20| 6e 6f 77 6e 20 67 6c 6f | 62 61 6c 20 76 61 72 69 |nown glo|bal vari|
|00002d30| 61 62 6c 65 73 20 62 65 | 63 61 75 73 65 20 74 68 |ables be|cause th|
|00002d40| 65 79 20 6d 61 79 20 6e | 6f 74 20 62 65 20 61 76 |ey may n|ot be av|
|00002d50| 61 69 6c 61 62 6c 65 20 | 69 6e 20 61 6c 6c 20 65 |ailable |in all e|
|00002d60| 6e 76 69 72 6f 6e 6d 65 | 6e 74 73 20 6f 72 20 69 |nvironme|nts or i|
|00002d70| 6e 20 74 68 65 20 66 75 | 74 75 72 65 2e d3 20 20 |n the fu|ture.. |
|00002d80| 48 65 72 65 d5 73 20 61 | 20 67 6f 6f 64 20 65 78 |Here.s a| good ex|
|00002d90| 61 6d 70 6c 65 2e 0d 41 | 6c 74 68 6f 75 67 68 20 |ample..A|lthough |
|00002da0| 44 54 49 6e 73 74 61 6c | 6c 20 69 73 20 61 76 61 |DTInstal|l is ava|
|00002db0| 69 6c 61 62 6c 65 20 6f | 6e 20 61 6c 6c 20 4d 61 |ilable o|n all Ma|
|00002dc0| 63 69 6e 74 6f 73 68 65 | 73 20 72 75 6e 6e 69 6e |cintoshe|s runnin|
|00002dd0| 67 20 53 79 73 74 65 6d | 20 37 2c 20 74 68 65 20 |g System| 7, the |
|00002de0| 70 61 74 63 68 20 74 68 | 61 74 20 61 64 64 65 64 |patch th|at added|
|00002df0| 20 74 68 65 20 44 65 66 | 65 72 72 65 64 20 54 61 | the Def|erred Ta|
|00002e00| 73 6b 20 4d 61 6e 61 67 | 65 72 20 74 6f 20 74 68 |sk Manag|er to th|
|00002e10| 65 20 4d 61 63 69 6e 74 | 6f 73 68 20 50 6c 75 73 |e Macint|osh Plus|
|00002e20| 20 63 6f 75 6c 64 20 6e | 6f 74 20 75 73 65 20 74 | could n|ot use t|
|00002e30| 68 65 20 6c 6f 77 2d 6d | 65 6d 6f 72 79 20 67 6c |he low-m|emory gl|
|00002e40| 6f 62 61 6c 73 20 44 54 | 51 75 65 75 65 20 28 74 |obals DT|Queue (t|
|00002e50| 68 65 20 64 65 66 65 72 | 72 65 64 20 74 61 73 6b |he defer|red task|
|00002e60| 20 71 75 65 75 65 20 68 | 65 61 64 65 72 29 20 61 | queue h|eader) a|
|00002e70| 6e 64 20 4a 44 54 49 6e | 73 74 61 6c 6c 20 28 74 |nd JDTIn|stall (t|
|00002e80| 68 65 20 6a 75 6d 70 20 | 76 65 63 74 6f 72 20 66 |he jump |vector f|
|00002e90| 6f 72 20 74 68 65 20 44 | 54 49 6e 73 74 61 6c 6c |or the D|TInstall|
|00002ea0| 20 72 6f 75 74 69 6e 65 | 29 2e 20 20 4f 6e 20 74 | routine|). On t|
|00002eb0| 68 65 20 4d 61 63 69 6e | 74 6f 73 68 20 50 6c 75 |he Macin|tosh Plu|
|00002ec0| 73 2c 20 74 68 65 20 71 | 75 65 75 65 20 68 65 61 |s, the q|ueue hea|
|00002ed0| 64 65 72 20 75 73 65 64 | 20 66 6f 72 20 64 65 66 |der used| for def|
|00002ee0| 65 72 72 65 64 20 74 61 | 73 6b 73 20 69 73 20 70 |erred ta|sks is p|
|00002ef0| 72 69 76 61 74 65 20 61 | 6e 64 20 74 68 65 72 65 |rivate a|nd there|
|00002f00| 20 69 73 20 6e 6f 20 6a | 75 6d 70 20 76 65 63 74 | is no j|ump vect|
|00002f10| 6f 72 20 74 6f 20 74 68 | 65 20 44 54 49 6e 73 74 |or to th|e DTInst|
|00002f20| 61 6c 6c 20 72 6f 75 74 | 69 6e 65 2e 20 20 44 6f |all rout|ine. Do|
|00002f30| 6e d5 74 20 75 73 65 20 | 44 54 51 75 65 75 65 20 |n.t use |DTQueue |
|00002f40| 6f 72 20 4a 44 54 49 6e | 73 74 61 6c 6c 20 6f 6e |or JDTIn|stall on|
|00002f50| 20 74 68 65 20 4d 61 63 | 69 6e 74 6f 73 68 20 50 | the Mac|intosh P|
|00002f60| 6c 75 73 2e 0d 48 6f 77 | 20 61 6e 64 20 77 68 65 |lus..How| and whe|
|00002f70| 6e 20 74 68 65 20 44 65 | 66 65 72 72 65 64 20 54 |n the De|ferred T|
|00002f80| 61 73 6b 20 4d 61 6e 61 | 67 65 72 20 63 61 6c 6c |ask Mana|ger call|
|00002f90| 73 20 64 65 66 65 72 72 | 65 64 20 74 61 73 6b 73 |s deferr|ed tasks|
|00002fa0| 0d 53 69 6e 63 65 20 75 | 6e 64 65 72 73 74 61 6e |.Since u|nderstan|
|00002fb0| 64 69 6e 67 20 68 6f 77 | 20 73 6f 6d 65 74 68 69 |ding how| somethi|
|00002fc0| 6e 67 20 77 6f 72 6b 73 | 20 75 73 75 61 6c 6c 79 |ng works| usually|
|00002fd0| 20 61 6e 73 77 65 72 73 | 20 6d 6f 73 74 20 71 75 | answers| most qu|
|00002fe0| 65 73 74 69 6f 6e 73 20 | 61 62 6f 75 74 20 69 74 |estions |about it|
|00002ff0| 2c 20 74 68 69 73 20 6e | 6f 74 65 20 67 69 76 65 |, this n|ote give|
|00003000| 73 20 61 20 63 6f 6d 70 | 6c 65 74 65 20 65 78 70 |s a comp|lete exp|
|00003010| 6c 61 6e 61 74 69 6f 6e | 20 6f 66 20 68 6f 77 20 |lanation| of how |
|00003020| 64 65 66 65 72 72 65 64 | 20 74 61 73 6b 73 20 67 |deferred| tasks g|
|00003030| 65 74 20 63 61 6c 6c 65 | 64 2e 20 20 49 d5 6c 6c |et calle|d. I.ll|
|00003040| 20 73 74 61 72 74 20 77 | 69 74 68 20 74 68 65 20 | start w|ith the |
|00003050| 6f 63 63 75 72 72 65 6e | 63 65 20 6f 66 20 61 6e |occurren|ce of an|
|00003060| 20 69 6e 74 65 72 72 75 | 70 74 2e 0d 57 68 65 6e | interru|pt..When|
|00003070| 20 61 6e 20 69 6e 74 65 | 72 72 75 70 74 20 6f 63 | an inte|rrupt oc|
|00003080| 63 75 72 73 2c 20 74 68 | 65 20 70 72 6f 63 65 73 |curs, th|e proces|
|00003090| 73 6f 72 20 73 74 6f 70 | 73 20 65 78 65 63 75 74 |sor stop|s execut|
|000030a0| 69 6e 67 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |ing the |current |
|000030b0| 70 72 6f 67 72 61 6d 20 | 61 6e 64 20 63 6f 6e 74 |program |and cont|
|000030c0| 72 6f 6c 20 69 73 20 70 | 61 73 73 65 64 20 74 6f |rol is p|assed to|
|000030d0| 20 74 68 65 20 4d 61 63 | 69 6e 74 6f 73 68 27 73 | the Mac|intosh's|
|000030e0| 20 70 72 69 6d 61 72 79 | 20 69 6e 74 65 72 72 75 | primary| interru|
|000030f0| 70 74 20 68 61 6e 64 6c | 65 72 2e 20 20 54 68 65 |pt handl|er. The|
|00003100| 20 70 72 69 6d 61 72 79 | 20 69 6e 74 65 72 72 75 | primary| interru|
|00003110| 70 74 20 68 61 6e 64 6c | 65 72 20 73 61 76 65 73 |pt handl|er saves|
|00003120| 20 72 65 67 69 73 74 65 | 72 73 20 41 30 2d 41 33 | registe|rs A0-A3|
|00003130| 2f 44 30 2d 44 33 20 61 | 6e 64 20 74 68 65 6e 20 |/D0-D3 a|nd then |
|00003140| 64 65 63 69 64 65 73 20 | 77 68 61 74 20 73 65 63 |decides |what sec|
|00003150| 6f 6e 64 61 72 79 20 69 | 6e 74 65 72 72 75 70 74 |ondary i|nterrupt|
|00003160| 20 68 61 6e 64 6c 65 72 | 20 74 6f 20 64 69 73 70 | handler| to disp|
|00003170| 61 74 63 68 20 74 6f 2e | 20 20 49 66 20 74 68 65 |atch to.| If the|
|00003180| 20 73 79 73 74 65 6d 20 | 68 61 73 20 61 6e 20 4d | system |has an M|
|00003190| 4d 55 2c 20 77 61 73 20 | 62 6f 6f 74 65 64 20 32 |MU, was |booted 2|
|000031a0| 34 2d 62 69 74 20 6d 6f | 64 65 20 62 75 74 20 69 |4-bit mo|de but i|
|000031b0| 73 20 70 72 65 73 65 6e | 74 6c 79 20 69 6e 20 33 |s presen|tly in 3|
|000031c0| 32 2d 62 69 74 20 6d 6f | 64 65 2c 20 74 68 65 6e |2-bit mo|de, then|
|000031d0| 20 74 68 65 20 4d 4d 55 | 20 73 74 61 74 65 20 69 | the MMU| state i|
|000031e0| 73 20 73 61 76 65 64 20 | 61 6e 64 20 74 68 65 20 |s saved |and the |
|000031f0| 4d 4d 55 20 69 73 20 73 | 77 69 74 63 68 65 64 20 |MMU is s|witched |
|00003200| 74 6f 20 32 34 2d 62 69 | 74 20 6d 6f 64 65 2e 20 |to 24-bi|t mode. |
|00003210| 20 49 66 20 74 68 65 20 | 73 79 73 74 65 6d 20 68 | If the |system h|
|00003220| 61 73 20 70 6f 77 65 72 | 20 6d 61 6e 61 67 65 6d |as power| managem|
|00003230| 65 6e 74 20 28 69 2e 65 | 2e 2c 20 69 73 20 61 20 |ent (i.e|., is a |
|00003240| 70 6f 72 74 61 62 6c 65 | 20 4d 61 63 69 6e 74 6f |portable| Macinto|
|00003250| 73 68 29 20 61 6e 64 20 | 69 73 20 69 6e 20 73 6c |sh) and |is in sl|
|00003260| 6f 77 20 73 70 65 65 64 | 2c 20 74 68 65 20 73 70 |ow speed|, the sp|
|00003270| 65 65 64 20 69 73 20 73 | 61 76 65 64 20 61 6e 64 |eed is s|aved and|
|00003280| 20 69 73 20 74 68 65 6e | 20 73 77 69 74 63 68 65 | is then| switche|
|00003290| 64 20 74 6f 20 66 75 6c | 6c 20 73 70 65 65 64 2e |d to ful|l speed.|
|000032a0| 20 20 43 6f 6e 74 72 6f | 6c 20 69 73 20 74 68 65 | Contro|l is the|
|000032b0| 6e 20 70 61 73 73 65 64 | 20 74 6f 20 74 68 65 20 |n passed| to the |
|000032c0| 73 65 63 6f 6e 64 61 72 | 79 20 69 6e 74 65 72 72 |secondar|y interr|
|000032d0| 75 70 74 20 68 61 6e 64 | 6c 65 72 20 77 68 69 63 |upt hand|ler whic|
|000032e0| 68 20 68 61 6e 64 6c 65 | 73 20 74 68 65 20 69 6e |h handle|s the in|
|000032f0| 74 65 72 72 75 70 74 2e | 0d 57 68 65 6e 20 63 6f |terrupt.|.When co|
|00003300| 6e 74 72 6f 6c 20 72 65 | 74 75 72 6e 73 20 74 6f |ntrol re|turns to|
|00003310| 20 74 68 65 20 70 72 69 | 6d 61 72 79 20 69 6e 74 | the pri|mary int|
|00003320| 65 72 72 75 70 74 20 68 | 61 6e 64 6c 65 72 20 66 |errupt h|andler f|
|00003330| 72 6f 6d 20 74 68 65 20 | 73 65 63 6f 6e 64 61 72 |rom the |secondar|
|00003340| 79 20 69 6e 74 65 72 72 | 75 70 74 20 68 61 6e 64 |y interr|upt hand|
|00003350| 6c 65 72 2c 20 74 68 65 | 20 70 72 69 6d 61 72 79 |ler, the| primary|
|00003360| 20 69 6e 74 65 72 72 75 | 70 74 20 68 61 6e 64 6c | interru|pt handl|
|00003370| 65 72 20 63 68 65 63 6b | 73 20 74 6f 20 73 65 65 |er check|s to see|
|00003380| 20 69 66 20 74 68 65 72 | 65 20 61 72 65 20 61 6e | if ther|e are an|
|00003390| 79 20 64 65 66 65 72 72 | 65 64 20 74 61 73 6b 73 |y deferr|ed tasks|
|000033a0| 20 69 6e 20 74 68 65 20 | 64 65 66 65 72 72 65 64 | in the |deferred|
|000033b0| 20 74 61 73 6b 20 71 75 | 65 75 65 20 61 6e 64 20 | task qu|eue and |
|000033c0| 63 68 65 63 6b 73 20 74 | 6f 20 73 65 65 20 69 66 |checks t|o see if|
|000033d0| 20 75 70 6f 6e 20 65 78 | 69 74 20 6f 66 20 74 68 | upon ex|it of th|
|000033e0| 69 73 20 69 6e 74 65 72 | 72 75 70 74 2c 20 74 68 |is inter|rupt, th|
|000033f0| 65 20 70 72 6f 63 65 73 | 73 6f 72 20 70 72 69 6f |e proces|sor prio|
|00003400| 72 69 74 79 20 6c 65 76 | 65 6c 20 77 69 6c 6c 20 |rity lev|el will |
|00003410| 62 65 20 72 65 74 75 72 | 6e 65 64 20 74 6f 20 30 |be retur|ned to 0|
|00003420| 2e 20 20 49 66 20 62 6f | 74 68 20 63 6f 6e 64 69 |. If bo|th condi|
|00003430| 74 69 6f 6e 73 20 61 72 | 65 20 74 72 75 65 2c 20 |tions ar|e true, |
|00003440| 63 6f 6e 74 72 6f 6c 20 | 69 73 20 70 61 73 73 65 |control |is passe|
|00003450| 64 20 74 6f 20 74 68 65 | 20 44 65 66 65 72 72 65 |d to the| Deferre|
|00003460| 64 20 54 61 73 6b 20 4d | 61 6e 61 67 65 72 20 74 |d Task M|anager t|
|00003470| 6f 20 65 78 65 63 75 74 | 65 20 74 68 6f 73 65 20 |o execut|e those |
|00003480| 74 61 73 6b 73 2e 0d 54 | 68 65 20 44 65 66 65 72 |tasks..T|he Defer|
|00003490| 72 65 64 20 54 61 73 6b | 20 4d 61 6e 61 67 65 72 |red Task| Manager|
|000034a0| 20 63 68 65 63 6b 73 20 | 74 6f 20 73 65 65 20 69 | checks |to see i|
|000034b0| 66 20 61 20 64 65 66 65 | 72 72 65 64 20 74 61 73 |f a defe|rred tas|
|000034c0| 6b 20 69 73 20 61 6c 72 | 65 61 64 79 20 61 63 74 |k is alr|eady act|
|000034d0| 69 76 65 3b 20 69 66 20 | 73 6f 2c 20 74 68 65 20 |ive; if |so, the |
|000034e0| 44 65 66 65 72 72 65 64 | 20 54 61 73 6b 20 4d 61 |Deferred| Task Ma|
|000034f0| 6e 61 67 65 72 20 65 78 | 69 74 73 2e 20 20 4f 74 |nager ex|its. Ot|
|00003500| 68 65 72 77 69 73 65 2c | 20 6f 6e 65 20 62 79 20 |herwise,| one by |
|00003510| 6f 6e 65 2c 20 65 61 63 | 68 20 64 65 66 65 72 72 |one, eac|h deferr|
|00003520| 65 64 20 74 61 73 6b 20 | 69 6e 20 74 68 65 20 64 |ed task |in the d|
|00003530| 65 66 65 72 72 65 64 20 | 74 61 73 6b 20 71 75 65 |eferred |task que|
|00003540| 75 65 20 69 73 20 64 65 | 71 75 65 75 65 64 2c 20 |ue is de|queued, |
|00003550| 61 6e 64 20 74 68 65 6e | 20 63 61 6c 6c 65 64 20 |and then| called |
|00003560| 77 69 74 68 20 72 65 67 | 69 73 74 65 72 20 41 31 |with reg|ister A1|
|00003570| 20 63 6f 6e 74 61 69 6e | 69 6e 67 20 64 74 50 61 | contain|ing dtPa|
|00003580| 72 6d 20 66 72 6f 6d 20 | 74 68 65 20 44 65 66 65 |rm from |the Defe|
|00003590| 72 72 65 64 54 61 73 6b | 20 72 65 63 6f 72 64 20 |rredTask| record |
|000035a0| 61 6e 64 20 74 68 65 20 | 70 72 6f 63 65 73 73 6f |and the |processo|
|000035b0| 72 20 70 72 69 6f 72 69 | 74 79 20 6c 65 76 65 6c |r priori|ty level|
|000035c0| 20 69 73 20 73 65 74 20 | 74 6f 20 30 20 28 69 2e | is set |to 0 (i.|
|000035d0| 65 2e 2c 20 61 6c 6c 20 | 69 6e 74 65 72 72 75 70 |e., all |interrup|
|000035e0| 74 73 20 61 72 65 20 65 | 6e 61 62 6c 65 64 29 2e |ts are e|nabled).|
|000035f0| 20 20 57 68 65 6e 20 61 | 6c 6c 20 64 65 66 65 72 | When a|ll defer|
|00003600| 72 65 64 20 74 61 73 6b | 73 20 68 61 76 65 20 62 |red task|s have b|
|00003610| 65 65 6e 20 64 65 71 75 | 65 75 65 64 20 61 6e 64 |een dequ|eued and|
|00003620| 20 63 61 6c 6c 65 64 2c | 20 63 6f 6e 74 72 6f 6c | called,| control|
|00003630| 20 69 73 20 72 65 74 75 | 72 6e 65 64 20 74 6f 20 | is retu|rned to |
|00003640| 74 68 65 20 70 72 69 6d | 61 72 79 20 69 6e 74 65 |the prim|ary inte|
|00003650| 72 72 75 70 74 20 68 61 | 6e 64 6c 65 72 2e 0d 57 |rrupt ha|ndler..W|
|00003660| 68 65 6e 20 63 6f 6e 74 | 72 6f 6c 20 72 65 74 75 |hen cont|rol retu|
|00003670| 72 6e 73 20 74 6f 20 70 | 72 69 6d 61 72 79 20 69 |rns to p|rimary i|
|00003680| 6e 74 65 72 72 75 70 74 | 20 68 61 6e 64 6c 65 72 |nterrupt| handler|
|00003690| 20 66 72 6f 6d 20 74 68 | 65 20 44 65 66 65 72 72 | from th|e Deferr|
|000036a0| 65 64 20 54 61 73 6b 20 | 4d 61 6e 61 67 65 72 2c |ed Task |Manager,|
|000036b0| 20 74 68 65 20 70 72 69 | 6d 61 72 79 20 69 6e 74 | the pri|mary int|
|000036c0| 65 72 72 75 70 74 20 68 | 61 6e 64 6c 65 72 20 72 |errupt h|andler r|
|000036d0| 65 73 74 6f 72 65 73 20 | 74 68 65 20 4d 4d 55 20 |estores |the MMU |
|000036e0| 73 74 61 74 65 20 61 6e | 64 20 73 70 65 65 64 20 |state an|d speed |
|000036f0| 69 66 20 6e 65 63 65 73 | 73 61 72 79 20 61 6e 64 |if neces|sary and|
|00003700| 20 74 68 65 6e 20 72 65 | 73 74 6f 72 65 73 20 72 | then re|stores r|
|00003710| 65 67 69 73 74 65 72 73 | 20 41 30 2d 41 33 2f 44 |egisters| A0-A3/D|
|00003720| 30 2d 44 33 2e 20 20 54 | 68 65 6e 20 74 68 65 20 |0-D3. T|hen the |
|00003730| 70 72 69 6d 61 72 79 20 | 69 6e 74 65 72 72 75 70 |primary |interrup|
|00003740| 74 20 68 61 6e 64 6c 65 | 72 20 72 65 74 75 72 6e |t handle|r return|
|00003750| 73 20 63 6f 6e 74 72 6f | 6c 20 74 6f 20 74 68 65 |s contro|l to the|
|00003760| 20 70 72 6f 67 72 61 6d | 20 65 78 65 63 75 74 69 | program| executi|
|00003770| 6e 67 20 62 65 66 6f 72 | 65 20 74 68 65 20 69 6e |ng befor|e the in|
|00003780| 74 65 72 72 75 70 74 20 | 6f 63 63 75 72 72 65 64 |terrupt |occurred|
|00003790| 2e 0d 57 69 74 68 20 74 | 68 61 74 20 65 78 70 6c |..With t|hat expl|
|000037a0| 61 6e 61 74 69 6f 6e 20 | 6f 75 74 20 6f 66 20 74 |anation |out of t|
|000037b0| 68 65 20 77 61 79 2c 20 | 68 65 72 65 20 61 72 65 |he way, |here are|
|000037c0| 20 61 20 66 65 77 20 74 | 68 69 6e 67 73 20 74 68 | a few t|hings th|
|000037d0| 61 74 20 6d 61 79 20 6f | 72 20 6d 61 79 20 6e 6f |at may o|r may no|
|000037e0| 74 20 62 65 20 6f 62 76 | 69 6f 75 73 2e 0d 44 65 |t be obv|ious..De|
|000037f0| 66 65 72 72 65 64 20 74 | 61 73 6b 73 20 61 72 65 |ferred t|asks are|
|00003800| 20 69 6e 74 65 72 72 75 | 70 74 20 74 69 6d 65 20 | interru|pt time |
|00003810| 63 6f 64 65 0d 54 68 61 | 74 20 69 73 2c 20 64 65 |code.Tha|t is, de|
|00003820| 66 65 72 72 65 64 20 74 | 61 73 6b 73 20 61 72 65 |ferred t|asks are|
|00003830| 20 72 75 6e 20 61 73 20 | 61 20 72 65 73 75 6c 74 | run as |a result|
|00003840| 20 6f 66 20 61 6e 20 69 | 6e 74 65 72 72 75 70 74 | of an i|nterrupt|
|00003850| 2e 20 20 41 20 64 65 66 | 65 72 72 65 64 20 74 61 |. A def|erred ta|
|00003860| 73 6b 20 6d 75 73 74 20 | 66 6f 6c 6c 6f 77 20 6d |sk must |follow m|
|00003870| 61 6e 79 20 6f 66 20 74 | 68 65 20 73 61 6d 65 20 |any of t|he same |
|00003880| 72 75 6c 65 73 20 61 73 | 20 61 20 69 6e 74 65 72 |rules as| a inter|
|00003890| 72 75 70 74 20 68 61 6e | 64 6c 65 72 2e 20 20 48 |rupt han|dler. H|
|000038a0| 65 72 65 d5 73 20 61 20 | 77 61 72 6e 69 6e 67 20 |ere.s a |warning |
|000038b0| 74 6f 20 67 6f 20 61 6c | 6f 6e 67 20 77 69 74 68 |to go al|ong with|
|000038c0| 20 74 68 65 20 6d 61 74 | 65 72 69 61 6c 20 69 6e | the mat|erial in|
|000038d0| 20 74 68 65 20 44 65 66 | 65 72 72 65 64 20 54 61 | the Def|erred Ta|
|000038e0| 73 6b 20 4d 61 6e 61 67 | 65 72 20 63 68 61 70 74 |sk Manag|er chapt|
|000038f0| 65 72 20 6f 66 20 49 6e | 73 69 64 65 20 4d 61 63 |er of In|side Mac|
|00003900| 69 6e 74 6f 73 68 20 56 | 6f 6c 75 6d 65 20 56 2e |intosh V|olume V.|
|00003910| 0d 57 61 72 6e 69 6e 67 | 3a 09 44 65 66 65 72 72 |.Warning|:.Deferr|
|00003920| 65 64 20 74 61 73 6b 73 | 20 61 72 65 20 65 78 65 |ed tasks| are exe|
|00003930| 63 75 74 65 64 20 61 74 | 20 74 68 65 20 69 6e 74 |cuted at| the int|
|00003940| 65 72 72 75 70 74 20 6c | 65 76 65 6c 20 61 6e 64 |errupt l|evel and|
|00003950| 20 6d 75 73 74 20 70 72 | 65 73 65 72 76 65 20 61 | must pr|eserve a|
|00003960| 6c 6c 20 72 65 67 69 73 | 74 65 72 73 20 6f 74 68 |ll regis|ters oth|
|00003970| 65 72 20 74 68 61 6e 20 | 41 30 2d 41 33 20 61 6e |er than |A0-A3 an|
|00003980| 64 20 44 30 2d 44 33 2e | 20 20 59 6f 75 72 20 64 |d D0-D3.| Your d|
|00003990| 65 66 65 72 72 65 64 20 | 74 61 73 6b 20 6d 75 73 |eferred |task mus|
|000039a0| 74 20 6e 6f 74 20 6d 61 | 6b 65 20 61 6e 79 20 63 |t not ma|ke any c|
|000039b0| 61 6c 6c 73 20 74 6f 20 | 74 68 65 20 4d 65 6d 6f |alls to |the Memo|
|000039c0| 72 79 20 4d 61 6e 61 67 | 65 72 2c 20 64 69 72 65 |ry Manag|er, dire|
|000039d0| 63 74 6c 79 20 6f 72 20 | 69 6e 64 69 72 65 63 74 |ctly or |indirect|
|000039e0| 6c 79 2c 20 61 6e 64 20 | 63 61 6e d5 74 20 64 65 |ly, and |can.t de|
|000039f0| 70 65 6e 64 20 6f 6e 20 | 68 61 6e 64 6c 65 73 20 |pend on |handles |
|00003a00| 74 6f 20 75 6e 6c 6f 63 | 6b 65 64 20 62 6c 6f 63 |to unloc|ked bloc|
|00003a10| 6b 73 20 62 65 69 6e 67 | 20 76 61 6c 69 64 2e 20 |ks being| valid. |
|00003a20| 20 49 66 20 69 74 20 75 | 73 65 73 20 61 70 70 6c | If it u|ses appl|
|00003a30| 69 63 61 74 69 6f 6e 20 | 67 6c 6f 62 61 6c 73 2c |ication |globals,|
|00003a40| 20 69 74 20 6d 75 73 74 | 20 61 6c 73 6f 20 65 6e | it must| also en|
|00003a50| 73 75 72 65 20 74 68 61 | 74 20 72 65 67 69 73 74 |sure tha|t regist|
|00003a60| 65 72 20 41 35 20 63 6f | 6e 74 61 69 6e 73 20 74 |er A5 co|ntains t|
|00003a70| 68 65 20 61 64 64 72 65 | 73 73 20 6f 66 20 74 68 |he addre|ss of th|
|00003a80| 65 20 62 6f 75 6e 64 61 | 72 79 20 62 65 74 77 65 |e bounda|ry betwe|
|00003a90| 65 6e 20 74 68 65 20 61 | 70 70 6c 69 63 61 74 69 |en the a|pplicati|
|00003aa0| 6f 6e 20 67 6c 6f 62 61 | 6c 73 20 61 6e 64 20 74 |on globa|ls and t|
|00003ab0| 68 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 70 |he appli|cation p|
|00003ac0| 61 72 61 6d 65 74 65 72 | 73 3b 20 66 6f 72 20 64 |arameter|s; for d|
|00003ad0| 65 74 61 69 6c 73 2c 20 | 73 65 65 20 53 65 74 74 |etails, |see Sett|
|00003ae0| 69 6e 67 20 61 6e 64 20 | 52 65 73 74 6f 72 69 6e |ing and |Restorin|
|00003af0| 67 20 74 68 65 20 41 35 | 20 52 65 67 69 73 74 65 |g the A5| Registe|
|00003b00| 72 20 69 6e 20 74 68 65 | 20 4d 65 6d 6f 72 79 20 |r in the| Memory |
|00003b10| 4d 61 6e 61 67 65 6d 65 | 6e 74 20 63 68 61 70 74 |Manageme|nt chapt|
|00003b20| 65 72 20 6f 66 20 49 6e | 73 69 64 65 20 4d 61 63 |er of In|side Mac|
|00003b30| 69 6e 74 6f 73 68 20 56 | 6f 6c 75 6d 65 20 56 49 |intosh V|olume VI|
|00003b40| 2e 20 20 59 6f 75 72 20 | 64 65 66 65 72 72 65 64 |. Your |deferred|
|00003b50| 20 74 61 73 6b 20 73 68 | 6f 75 6c 64 20 61 76 6f | task sh|ould avo|
|00003b60| 69 64 20 61 63 63 65 73 | 73 69 6e 67 20 61 20 6c |id acces|sing a l|
|00003b70| 6f 77 2d 6d 65 6d 6f 72 | 79 20 76 61 72 69 61 62 |ow-memor|y variab|
|00003b80| 6c 65 73 20 6f 72 20 63 | 61 6c 6c 69 6e 67 20 61 |les or c|alling a|
|00003b90| 20 74 72 61 70 20 74 68 | 61 74 20 77 6f 75 6c 64 | trap th|at would|
|00003ba0| 20 61 63 63 65 73 73 20 | 6f 6e 65 20 62 65 63 61 | access |one beca|
|00003bb0| 75 73 65 20 77 68 69 6c | 65 20 4d 75 6c 74 69 46 |use whil|e MultiF|
|00003bc0| 69 6e 64 65 72 a8 20 6f | 72 20 53 79 73 74 65 6d |inder. o|r System|
|00003bd0| 20 37 20 69 73 20 72 75 | 6e 6e 69 6e 67 2c 20 61 | 7 is ru|nning, a|
|00003be0| 70 70 6c 69 63 61 74 69 | 6f 6e 20 6c 6f 77 2d 6d |pplicati|on low-m|
|00003bf0| 65 6d 6f 72 79 20 67 6c | 6f 62 61 6c 20 76 61 72 |emory gl|obal var|
|00003c00| 69 61 62 6c 65 73 20 61 | 72 65 20 62 65 69 6e 67 |iables a|re being|
|00003c10| 20 73 77 61 70 70 65 64 | 20 69 6e 20 61 6e 64 20 | swapped| in and |
|00003c20| 6f 75 74 2e 20 0d 44 65 | 66 65 72 72 65 64 20 74 |out. .De|ferred t|
|00003c30| 61 73 6b 73 20 63 61 6e | 20 62 65 20 69 6e 74 65 |asks can| be inte|
|00003c40| 72 72 75 70 74 65 64 0d | 54 68 61 74 d5 73 20 74 |rrupted.|That.s t|
|00003c50| 68 65 20 70 75 72 70 6f | 73 65 20 6f 66 20 75 73 |he purpo|se of us|
|00003c60| 69 6e 67 20 64 65 66 65 | 72 72 65 64 20 74 61 73 |ing defe|rred tas|
|00003c70| 6b 73 20 2d 20 74 6f 20 | 6c 65 74 20 69 6e 74 65 |ks - to |let inte|
|00003c80| 72 72 75 70 74 20 64 72 | 69 76 65 6e 20 70 72 6f |rrupt dr|iven pro|
|00003c90| 63 65 73 73 65 73 20 6b | 65 65 70 20 72 75 6e 6e |cesses k|eep runn|
|00003ca0| 69 6e 67 20 77 68 69 6c | 65 20 79 6f 75 72 20 64 |ing whil|e your d|
|00003cb0| 65 66 65 72 72 65 64 20 | 74 61 73 6b 20 63 6f 6d |eferred |task com|
|00003cc0| 70 6c 65 74 65 73 20 61 | 20 6c 65 6e 67 74 68 79 |pletes a| lengthy|
|00003cd0| 20 74 61 73 6b 2e 20 20 | 54 68 69 73 20 6d 65 61 | task. |This mea|
|00003ce0| 6e 73 20 74 68 61 74 20 | 79 6f 75 72 20 64 65 66 |ns that |your def|
|00003cf0| 65 72 72 65 64 20 74 61 | 73 6b 20 6d 75 73 74 20 |erred ta|sk must |
|00003d00| 62 65 20 69 6e 74 65 72 | 72 75 70 74 69 62 6c 65 |be inter|ruptible|
|00003d10| d1 74 68 61 74 20 69 73 | 2c 20 79 6f 75 20 73 68 |.that is|, you sh|
|00003d20| 6f 75 6c 64 20 6e 6f 74 | 20 68 61 76 65 20 74 6f |ould not| have to|
|00003d30| 20 64 6f 20 61 6e 79 74 | 68 69 6e 67 20 73 75 63 | do anyt|hing suc|
|00003d40| 68 20 61 73 20 74 69 6d | 69 6e 67 2d 63 72 69 74 |h as tim|ing-crit|
|00003d50| 69 63 61 6c 20 68 61 72 | 64 77 61 72 65 20 61 63 |ical har|dware ac|
|00003d60| 63 65 73 73 20 74 68 61 | 74 20 63 61 6e 20 67 65 |cess tha|t can ge|
|00003d70| 74 20 73 63 72 65 77 65 | 64 20 75 70 20 77 69 74 |t screwe|d up wit|
|00003d80| 68 20 69 6e 74 65 72 72 | 75 70 74 73 20 6f 6e 2e |h interr|upts on.|
|00003d90| 0d 49 66 20 74 68 65 20 | 69 6e 74 65 72 72 75 70 |.If the |interrup|
|00003da0| 74 20 68 61 6e 64 6c 65 | 72 20 74 68 61 74 20 69 |t handle|r that i|
|00003db0| 6e 73 74 61 6c 6c 73 20 | 74 68 65 20 64 65 66 65 |nstalls |the defe|
|00003dc0| 72 72 65 64 20 74 61 73 | 6b 20 63 61 6e 20 62 65 |rred tas|k can be|
|00003dd0| 20 63 61 6c 6c 65 64 20 | 61 67 61 69 6e 20 77 68 | called |again wh|
|00003de0| 69 6c 65 20 74 68 61 74 | 20 64 65 66 65 72 72 65 |ile that| deferre|
|00003df0| 64 20 74 61 73 6b 20 69 | 73 20 65 78 65 63 75 74 |d task i|s execut|
|00003e00| 69 6e 67 2c 20 74 68 65 | 6e 20 79 6f 75 20 61 6c |ing, the|n you al|
|00003e10| 73 6f 20 6e 65 65 64 20 | 74 6f 20 6d 61 6b 65 20 |so need |to make |
|00003e20| 73 75 72 65 20 74 68 65 | 20 77 61 79 20 74 68 65 |sure the| way the|
|00003e30| 20 69 6e 74 65 72 72 75 | 70 74 20 68 61 6e 64 6c | interru|pt handl|
|00003e40| 65 72 20 61 6e 64 20 74 | 68 65 20 64 65 66 65 72 |er and t|he defer|
|00003e50| 72 65 64 20 74 61 73 6b | 20 63 6f 64 65 20 77 6f |red task| code wo|
|00003e60| 72 6b 20 74 6f 67 65 74 | 68 65 72 20 69 73 20 72 |rk toget|her is r|
|00003e70| 65 65 6e 74 72 61 6e 74 | 2e 20 20 46 6f 72 20 65 |eentrant|. For e|
|00003e80| 78 61 6d 70 6c 65 2c 20 | 74 68 65 20 69 6e 74 65 |xample, |the inte|
|00003e90| 72 72 75 70 74 20 63 6f | 64 65 20 73 68 6f 75 6c |rrupt co|de shoul|
|00003ea0| 64 20 6e 6f 74 20 6d 6f | 64 69 66 79 20 61 20 64 |d not mo|dify a d|
|00003eb0| 61 74 61 20 62 75 66 66 | 65 72 20 74 68 61 74 20 |ata buff|er that |
|00003ec0| 74 68 65 20 64 65 66 65 | 72 72 65 64 20 74 61 73 |the defe|rred tas|
|00003ed0| 6b 20 69 73 20 70 72 6f | 63 65 73 73 69 6e 67 2e |k is pro|cessing.|
|00003ee0| 0d 44 65 66 65 72 72 65 | 64 20 74 61 73 6b 73 20 |.Deferre|d tasks |
|00003ef0| 61 72 65 20 6e 6f 74 20 | 70 72 69 6f 72 69 74 69 |are not |prioriti|
|00003f00| 7a 65 64 0d 44 65 66 65 | 72 72 65 64 20 74 61 73 |zed.Defe|rred tas|
|00003f10| 6b 73 20 61 72 65 20 65 | 78 65 63 75 74 65 64 20 |ks are e|xecuted |
|00003f20| 69 6e 20 74 68 65 20 6f | 72 64 65 72 20 74 68 65 |in the o|rder the|
|00003f30| 79 20 77 65 72 65 20 61 | 64 64 65 64 20 74 6f 20 |y were a|dded to |
|00003f40| 74 68 65 20 64 65 66 65 | 72 72 65 64 20 74 61 73 |the defe|rred tas|
|00003f50| 6b 20 71 75 65 75 65 20 | 6e 6f 20 6d 61 74 74 65 |k queue |no matte|
|00003f60| 72 20 77 68 61 74 20 69 | 6e 74 65 72 72 75 70 74 |r what i|nterrupt|
|00003f70| 20 6c 65 76 65 6c 20 74 | 68 65 20 63 6f 64 65 20 | level t|he code |
|00003f80| 69 6e 73 74 61 6c 6c 69 | 6e 67 20 74 68 65 20 74 |installi|ng the t|
|00003f90| 61 73 6b 20 6d 61 79 20 | 68 61 76 65 20 62 65 65 |ask may |have bee|
|00003fa0| 6e 20 72 75 6e 6e 69 6e | 67 20 61 74 2e 0d 44 65 |n runnin|g at..De|
|00003fb0| 66 65 72 72 65 64 20 74 | 61 73 6b 20 6c 61 74 65 |ferred t|ask late|
|00003fc0| 6e 63 79 0d 54 68 65 72 | 65 20 6d 61 79 20 62 65 |ncy.Ther|e may be|
|00003fd0| 20 73 69 67 6e 69 66 69 | 63 61 6e 74 20 6c 61 74 | signifi|cant lat|
|00003fe0| 65 6e 63 79 20 69 6e 63 | 75 72 72 65 64 20 62 65 |ency inc|urred be|
|00003ff0| 74 77 65 65 6e 20 69 6e | 73 74 61 6c 6c 69 6e 67 |tween in|stalling|
|00004000| 20 61 20 64 65 66 65 72 | 72 65 64 20 74 61 73 6b | a defer|red task|
|00004010| 20 77 69 74 68 20 44 54 | 49 6e 73 74 61 6c 6c 20 | with DT|Install |
|00004020| 61 6e 64 20 77 68 65 6e | 20 74 68 61 74 20 74 61 |and when| that ta|
|00004030| 73 6b 20 69 73 20 70 65 | 72 66 6f 72 6d 65 64 2e |sk is pe|rformed.|
|00004040| 20 20 54 68 69 73 20 74 | 69 6d 65 20 69 73 20 6e | This t|ime is n|
|00004050| 6f 74 20 64 65 74 65 72 | 6d 69 6e 69 73 74 69 63 |ot deter|ministic|
|00004060| 20 61 6e 64 20 63 61 6e | 6e 6f 74 20 62 65 20 63 | and can|not be c|
|00004070| 6f 6e 74 72 6f 6c 6c 65 | 64 2e 20 20 52 65 61 6c |ontrolle|d. Real|
|00004080| 2d 74 69 6d 65 20 72 65 | 73 70 6f 6e 73 65 20 63 |-time re|sponse c|
|00004090| 61 6e 6e 6f 74 20 62 65 | 20 67 75 61 72 61 6e 74 |annot be| guarant|
|000040a0| 65 65 64 20 6f 6e 20 4d | 61 63 69 6e 74 6f 73 68 |eed on M|acintosh|
|000040b0| 20 63 6f 6d 70 75 74 65 | 72 73 20 77 69 74 68 20 | compute|rs with |
|000040c0| 6f 72 20 77 69 74 68 6f | 75 74 20 74 68 65 20 75 |or witho|ut the u|
|000040d0| 73 65 20 6f 66 20 64 65 | 66 65 72 72 65 64 20 74 |se of de|ferred t|
|000040e0| 61 73 6b 73 2e 0d 41 62 | 6f 75 74 20 74 68 65 20 |asks..Ab|out the |
|000040f0| 44 65 66 65 72 72 65 64 | 54 61 73 6b 20 72 65 63 |Deferred|Task rec|
|00004100| 6f 72 64 0d 57 68 65 6e | 20 79 6f 75 20 69 6e 73 |ord.When| you ins|
|00004110| 74 61 6c 6c 20 61 20 64 | 65 66 65 72 72 65 64 20 |tall a d|eferred |
|00004120| 74 61 73 6b 20 77 69 74 | 68 20 44 54 49 6e 73 74 |task wit|h DTInst|
|00004130| 61 6c 6c 2c 20 79 6f 75 | 20 61 72 65 20 67 69 76 |all, you| are giv|
|00004140| 69 6e 67 20 79 6f 75 72 | 20 44 65 66 65 72 72 65 |ing your| Deferre|
|00004150| 64 54 61 73 6b 20 72 65 | 63 6f 72 64 20 74 6f 20 |dTask re|cord to |
|00004160| 74 68 65 20 73 79 73 74 | 65 6d 3b 20 74 68 65 20 |the syst|em; the |
|00004170| 73 79 73 74 65 6d 20 6f | 77 6e 73 20 74 68 65 20 |system o|wns the |
|00004180| 72 65 63 6f 72 64 20 75 | 6e 74 69 6c 20 74 68 65 |record u|ntil the|
|00004190| 20 72 6f 75 74 69 6e 65 | 20 64 65 73 69 67 6e 61 | routine| designa|
|000041a0| 74 65 64 20 62 79 20 74 | 68 65 20 44 65 66 65 72 |ted by t|he Defer|
|000041b0| 72 65 64 54 61 73 6b 20 | 72 65 63 6f 72 64 d5 73 |redTask |record.s|
|000041c0| 20 64 74 41 64 64 72 20 | 66 69 65 6c 64 20 69 73 | dtAddr |field is|
|000041d0| 20 65 6e 74 65 72 65 64 | 2e 20 20 44 75 72 69 6e | entered|. Durin|
|000041e0| 67 20 74 68 65 20 74 69 | 6d 65 20 74 68 65 20 73 |g the ti|me the s|
|000041f0| 79 73 74 65 6d 20 6f 77 | 6e 73 20 61 20 44 65 66 |ystem ow|ns a Def|
|00004200| 65 72 72 65 64 54 61 73 | 6b 20 72 65 63 6f 72 64 |erredTas|k record|
|00004210| 2c 20 79 6f 75 20 6d 75 | 73 74 20 6e 6f 74 20 63 |, you mu|st not c|
|00004220| 68 61 6e 67 65 20 61 6e | 79 20 6f 66 20 74 68 65 |hange an|y of the|
|00004230| 20 66 69 65 6c 64 73 20 | 6f 66 20 74 68 61 74 20 | fields |of that |
|00004240| 72 65 63 6f 72 64 2e 20 | 20 53 69 6d 69 6c 61 72 |record. | Similar|
|00004250| 6c 79 2c 20 79 6f 75 20 | 6d 75 73 74 20 6e 6f 74 |ly, you |must not|
|00004260| 20 64 65 70 65 6e 64 20 | 6f 6e 20 74 68 65 20 63 | depend |on the c|
|00004270| 6f 6e 74 65 6e 74 73 20 | 6f 66 20 74 68 65 20 72 |ontents |of the r|
|00004280| 65 63 6f 72 64 20 77 68 | 65 6e 20 69 74 20 69 73 |ecord wh|en it is|
|00004290| 20 6f 77 6e 65 64 20 62 | 79 20 74 68 65 20 73 79 | owned b|y the sy|
|000042a0| 73 74 65 6d 2e 20 20 54 | 68 65 20 73 79 73 74 65 |stem. T|he syste|
|000042b0| 6d 20 69 73 20 66 72 65 | 65 20 74 6f 20 61 6c 74 |m is fre|e to alt|
|000042c0| 65 72 20 74 68 65 20 72 | 65 63 6f 72 64 20 69 6e |er the r|ecord in|
|000042d0| 20 61 6e 79 20 66 61 73 | 68 69 6f 6e 20 77 68 69 | any fas|hion whi|
|000042e0| 6c 65 20 69 74 20 68 61 | 73 20 6f 77 6e 65 72 73 |le it ha|s owners|
|000042f0| 68 69 70 20 61 6e 64 20 | 72 65 73 74 6f 72 65 73 |hip and |restores|
|00004300| 20 74 68 65 20 72 65 63 | 6f 72 64 20 74 6f 20 69 | the rec|ord to i|
|00004310| 74 73 20 6f 72 69 67 69 | 6e 61 6c 20 73 74 61 74 |ts origi|nal stat|
|00004320| 65 20 70 72 69 6f 72 20 | 74 6f 20 69 6e 76 6f 6b |e prior |to invok|
|00004330| 69 6e 67 20 74 68 65 20 | 64 65 66 65 72 72 65 64 |ing the |deferred|
|00004340| 20 74 61 73 6b 2e 20 20 | 59 6f 75 20 6d 75 73 74 | task. |You must|
|00004350| 20 6e 6f 74 20 69 6e 73 | 74 61 6c 6c 20 61 20 44 | not ins|tall a D|
|00004360| 65 66 65 72 72 65 64 54 | 61 73 6b 20 72 65 63 6f |eferredT|ask reco|
|00004370| 72 64 20 77 68 69 63 68 | 20 69 73 20 61 6c 72 65 |rd which| is alre|
|00004380| 61 64 79 20 6f 77 6e 65 | 64 20 62 79 20 74 68 65 |ady owne|d by the|
|00004390| 20 73 79 73 74 65 6d 2e | 20 20 46 69 6e 61 6c 6c | system.| Finall|
|000043a0| 79 2c 20 79 6f 75 20 6d | 75 73 74 20 6e 6f 74 20 |y, you m|ust not |
|000043b0| 75 73 65 20 74 68 65 20 | 64 74 52 65 73 65 72 76 |use the |dtReserv|
|000043c0| 65 64 20 66 69 65 6c 64 | 20 66 6f 72 20 61 6e 79 |ed field| for any|
|000043d0| 20 70 75 72 70 6f 73 65 | 3b 20 69 74 20 73 68 6f | purpose|; it sho|
|000043e0| 75 6c 64 20 62 65 20 73 | 65 74 20 74 6f 20 7a 65 |uld be s|et to ze|
|000043f0| 72 6f 20 70 72 69 6f 72 | 20 74 6f 20 69 6e 73 74 |ro prior| to inst|
|00004400| 61 6c 6c 69 6e 67 20 61 | 20 64 65 66 65 72 72 65 |alling a| deferre|
|00004410| 64 20 74 61 73 6b 20 77 | 69 74 68 20 44 54 49 6e |d task w|ith DTIn|
|00004420| 73 74 61 6c 6c 2e 0d 41 | 63 63 65 73 73 69 6e 67 |stall..A|ccessing|
|00004430| 20 64 74 50 61 72 6d 20 | 66 72 6f 6d 20 64 65 66 | dtParm |from def|
|00004440| 65 72 72 65 64 20 74 61 | 73 6b 73 20 77 72 69 74 |erred ta|sks writ|
|00004450| 74 65 6e 20 69 6e 20 50 | 61 73 63 61 6c 20 61 6e |ten in P|ascal an|
|00004460| 64 20 43 0d 41 6c 6c 20 | 69 74 20 74 61 6b 65 73 |d C.All |it takes|
|00004470| 20 69 73 20 61 20 6c 69 | 74 74 6c 65 20 61 73 73 | is a li|ttle ass|
|00004480| 65 6d 62 6c 79 20 6c 61 | 6e 67 75 61 67 65 20 67 |embly la|nguage g|
|00004490| 6c 75 65 20 74 6f 20 67 | 65 74 20 74 68 65 20 76 |lue to g|et the v|
|000044a0| 61 6c 75 65 20 6f 66 20 | 64 74 50 61 72 6d 20 77 |alue of |dtParm w|
|000044b0| 68 69 63 68 20 69 73 20 | 70 61 73 73 65 64 20 74 |hich is |passed t|
|000044c0| 6f 20 74 68 65 20 64 65 | 66 65 72 72 65 64 20 74 |o the de|ferred t|
|000044d0| 61 73 6b 20 69 6e 20 72 | 65 67 69 73 74 65 72 20 |ask in r|egister |
|000044e0| 41 31 2e 20 20 48 65 72 | 65 20 61 72 65 20 65 78 |A1. Her|e are ex|
|000044f0| 61 6d 70 6c 65 73 20 69 | 6e 20 50 61 73 63 61 6c |amples i|n Pascal|
|00004500| 20 61 6e 64 20 43 20 73 | 68 6f 77 69 6e 67 20 68 | and C s|howing h|
|00004510| 6f 77 20 74 6f 20 67 65 | 74 20 74 68 65 20 76 61 |ow to ge|t the va|
|00004520| 6c 75 65 20 6f 66 20 64 | 74 50 61 72 6d 20 66 72 |lue of d|tParm fr|
|00004530| 6f 6d 20 72 65 67 69 73 | 74 65 72 20 41 31 2e 0d |om regis|ter A1..|
|00004540| 49 6e 20 50 61 73 63 61 | 6c 3a 0d 20 20 20 20 46 |In Pasca|l:. F|
|00004550| 55 4e 43 54 49 4f 4e 20 | 47 65 74 44 74 50 61 72 |UNCTION |GetDtPar|
|00004560| 6d 3a 20 4c 6f 6e 67 49 | 6e 74 3b 0d 20 20 20 20 |m: LongI|nt;. |
|00004570| 49 4e 4c 49 4e 45 0d 20 | 20 20 20 20 20 20 24 32 |INLINE. | $2|
|00004580| 45 38 39 3b 20 20 20 7b | 20 4d 4f 56 45 2e 4c 20 |E89; {| MOVE.L |
|00004590| 20 41 31 2c 28 53 50 29 | 20 7d 0d 20 20 20 20 50 | A1,(SP)| }. P|
|000045a0| 52 4f 43 45 44 55 52 45 | 20 44 6f 44 65 66 65 72 |ROCEDURE| DoDefer|
|000045b0| 72 65 64 54 61 73 6b 28 | 64 74 50 61 72 6d 3a 20 |redTask(|dtParm: |
|000045c0| 4c 6f 6e 67 49 6e 74 29 | 3b 0d 20 20 20 20 42 45 |LongInt)|;. BE|
|000045d0| 47 49 4e 0d 20 20 20 20 | 20 20 20 7b 20 79 6f 75 |GIN. | { you|
|000045e0| 72 20 64 65 66 65 72 72 | 65 64 20 74 61 73 6b 20 |r deferr|ed task |
|000045f0| 63 6f 64 65 20 67 6f 65 | 73 20 68 65 72 65 20 7d |code goe|s here }|
|00004600| 0d 20 20 20 20 45 4e 44 | 3b 0d 20 20 20 20 50 52 |. END|;. PR|
|00004610| 4f 43 45 44 55 52 45 20 | 4d 79 44 65 66 65 72 72 |OCEDURE |MyDeferr|
|00004620| 65 64 54 61 73 6b 3b 0d | 20 20 20 20 20 20 20 56 |edTask;.| V|
|00004630| 41 52 0d 20 20 20 20 20 | 20 20 20 20 20 64 74 50 |AR. | dtP|
|00004640| 61 72 6d 3a 20 4c 6f 6e | 67 49 6e 74 3b 0d 20 20 |arm: Lon|gInt;. |
|00004650| 20 20 42 45 47 49 4e 0d | 20 20 20 20 20 20 20 64 | BEGIN.| d|
|00004660| 74 50 61 72 6d 20 3a 3d | 20 47 65 74 44 74 50 61 |tParm :=| GetDtPa|
|00004670| 72 6d 3b 20 20 20 20 7b | 20 67 65 74 20 76 61 6c |rm; {| get val|
|00004680| 75 65 20 6f 66 20 64 74 | 50 61 72 6d 20 7d 0d 20 |ue of dt|Parm }. |
|00004690| 20 20 20 20 20 20 44 6f | 44 65 66 65 72 72 65 64 | Do|Deferred|
|000046a0| 54 61 73 6b 28 64 74 50 | 61 72 6d 29 3b 20 7b 20 |Task(dtP|arm); { |
|000046b0| 64 6f 20 64 65 66 65 72 | 72 65 64 20 74 61 73 6b |do defer|red task|
|000046c0| 20 7d 0d 20 20 20 20 45 | 4e 44 3b 0d 49 6e 20 43 | }. E|ND;.In C|
|000046d0| 3a 0d 20 20 20 20 70 61 | 73 63 61 6c 20 6c 6f 6e |:. pa|scal lon|
|000046e0| 67 20 47 65 74 44 74 50 | 61 72 6d 28 76 6f 69 64 |g GetDtP|arm(void|
|000046f0| 29 3b 0d 20 20 20 20 20 | 20 20 7b 20 30 78 32 45 |);. | { 0x2E|
|00004700| 38 39 20 7d 3b 20 20 2f | 2a 20 4d 4f 56 45 2e 4c |89 }; /|* MOVE.L|
|00004710| 20 20 41 31 2c 28 53 50 | 29 20 2a 2f 0d 20 20 20 | A1,(SP|) */. |
|00004720| 20 76 6f 69 64 20 44 6f | 44 65 66 65 72 72 65 64 | void Do|Deferred|
|00004730| 54 61 73 6b 28 64 74 50 | 61 72 6d 29 0d 20 20 20 |Task(dtP|arm). |
|00004740| 20 6c 6f 6e 67 20 20 20 | 64 74 50 61 72 6d 3b 0d | long |dtParm;.|
|00004750| 20 20 20 20 7b 0d 20 20 | 20 20 20 20 20 20 2f 2a | {. | /*|
|00004760| 20 79 6f 75 72 20 64 65 | 66 65 72 72 65 64 20 74 | your de|ferred t|
|00004770| 61 73 6b 20 63 6f 64 65 | 20 67 6f 65 73 20 68 65 |ask code| goes he|
|00004780| 72 65 20 2a 2f 0d 20 20 | 20 20 7d 0d 20 20 20 20 |re */. | }. |
|00004790| 76 6f 69 64 20 4d 79 44 | 65 66 65 72 72 65 64 54 |void MyD|eferredT|
|000047a0| 61 73 6b 28 76 6f 69 64 | 29 0d 20 20 20 20 7b 0d |ask(void|). {.|
|000047b0| 20 20 20 20 20 20 20 20 | 6c 6f 6e 67 20 20 20 64 | |long d|
|000047c0| 74 50 61 72 6d 3b 0d 20 | 20 20 20 20 20 20 20 64 |tParm;. | d|
|000047d0| 74 50 61 72 6d 20 3d 20 | 47 65 74 44 74 50 61 72 |tParm = |GetDtPar|
|000047e0| 6d 28 29 3b 20 20 20 2f | 2a 20 67 65 74 20 76 61 |m(); /|* get va|
|000047f0| 6c 75 65 20 6f 66 20 64 | 74 50 61 72 6d 20 2a 2f |lue of d|tParm */|
|00004800| 0d 20 20 20 20 20 20 20 | 20 44 6f 44 65 66 65 72 |. | DoDefer|
|00004810| 72 65 64 54 61 73 6b 28 | 64 74 50 61 72 6d 29 3b |redTask(|dtParm);|
|00004820| 20 2f 2a 20 64 6f 20 64 | 65 66 65 72 72 65 64 20 | /* do d|eferred |
|00004830| 74 61 73 6b 20 2a 2f 0d | 20 20 20 20 7d 0d 4e 6f |task */.| }.No|
|00004840| 74 69 63 65 20 74 68 61 | 74 20 74 68 65 20 64 65 |tice tha|t the de|
|00004850| 66 65 72 72 65 64 20 74 | 61 73 6b 20 69 73 20 62 |ferred t|ask is b|
|00004860| 72 6f 6b 65 6e 20 69 6e | 74 6f 20 74 77 6f 20 70 |roken in|to two p|
|00004870| 61 72 74 73 3a 20 4d 79 | 44 65 66 65 72 72 65 64 |arts: My|Deferred|
|00004880| 54 61 73 6b 20 77 68 69 | 63 68 20 69 73 20 63 61 |Task whi|ch is ca|
|00004890| 6c 6c 65 64 20 62 79 20 | 74 68 65 20 44 65 66 65 |lled by |the Defe|
|000048a0| 72 72 65 64 20 54 61 73 | 6b 20 4d 61 6e 61 67 65 |rred Tas|k Manage|
|000048b0| 72 20 61 6e 64 20 44 6f | 44 65 66 65 72 72 65 64 |r and Do|Deferred|
|000048c0| 54 61 73 6b 20 77 68 69 | 63 68 20 63 6f 6e 74 61 |Task whi|ch conta|
|000048d0| 69 6e 73 20 74 68 65 20 | 64 65 66 65 72 72 65 64 |ins the |deferred|
|000048e0| 20 74 61 73 6b 20 63 6f | 64 65 2e 20 20 54 68 69 | task co|de. Thi|
|000048f0| 73 20 69 73 20 64 6f 6e | 65 20 74 6f 20 70 72 65 |s is don|e to pre|
|00004900| 76 65 6e 74 20 70 72 6f | 62 6c 65 6d 73 20 63 61 |vent pro|blems ca|
|00004910| 75 73 65 64 20 62 79 20 | 73 6f 6d 65 20 6f 70 74 |used by |some opt|
|00004920| 69 6d 69 7a 69 6e 67 20 | 63 6f 6d 70 69 6c 65 72 |imizing |compiler|
|00004930| 73 2e 20 20 53 65 65 20 | 54 65 63 68 6e 69 63 61 |s. See |Technica|
|00004940| 6c 20 4e 6f 74 65 20 23 | 32 30 38 2c 20 53 65 74 |l Note #|208, Set|
|00004950| 74 69 6e 67 20 61 6e 64 | 20 52 65 73 74 6f 72 69 |ting and| Restori|
|00004960| 6e 67 20 41 35 20 66 6f | 72 20 64 65 74 61 69 6c |ng A5 fo|r detail|
|00004970| 73 2e 0d 46 75 72 74 68 | 65 72 20 52 65 66 65 72 |s..Furth|er Refer|
|00004980| 65 6e 63 65 3a 0d a5 09 | 49 6e 73 69 64 65 20 4d |ence:...|Inside M|
|00004990| 61 63 69 6e 74 6f 73 68 | 2c 20 56 6f 6c 75 6d 65 |acintosh|, Volume|
|000049a0| 20 56 2c 20 54 68 65 20 | 44 65 66 65 72 72 65 64 | V, The |Deferred|
|000049b0| 20 54 61 73 6b 20 4d 61 | 6e 61 67 65 72 0d a5 09 | Task Ma|nager...|
|000049c0| 54 65 63 68 6e 69 63 61 | 6c 20 4e 6f 74 65 20 4d |Technica|l Note M|
|000049d0| 2e 4f 56 2e 41 35 20 d1 | 0d 09 09 53 65 74 74 69 |.OV.A5 .|...Setti|
|000049e0| 6e 67 20 61 6e 64 20 52 | 65 73 74 6f 72 69 6e 67 |ng and R|estoring|
|000049f0| 20 41 35 0d 55 73 69 6e | 67 20 4d 6f 64 65 6c 65 | A5.Usin|g Modele|
|00004a00| 73 73 20 44 69 61 6c 6f | 67 73 20 66 72 6f 6d 20 |ss Dialo|gs from |
|00004a10| 44 65 73 6b 20 41 63 63 | 65 73 73 6f 72 69 65 73 |Desk Acc|essories|
|00004a20| 0d 50 72 6f 63 65 73 73 | 65 73 09 4d 2e 50 53 2e |.Process|es.M.PS.|
|00004a30| 44 69 61 6c 6f 67 73 49 | 6e 44 41 73 0d 52 65 76 |DialogsI|nDAs.Rev|
|00004a40| 69 73 65 64 09 09 20 41 | 70 72 69 6c 20 31 39 38 |ised.. A|pril 198|
|00004a50| 35 0d 57 72 69 74 74 65 | 6e 20 62 79 3a 09 52 75 |5.Writte|n by:.Ru|
|00004a60| 73 73 20 44 61 6e 69 65 | 6c 73 09 4d 61 72 63 68 |ss Danie|ls.March|
|00004a70| 20 31 39 38 38 0d 57 68 | 65 6e 20 61 20 64 65 73 | 1988.Wh|en a des|
|00004a80| 6b 20 61 63 63 65 73 73 | 6f 72 79 20 63 72 65 61 |k access|ory crea|
|00004a90| 74 65 73 20 61 20 77 69 | 6e 64 6f 77 20 28 69 6e |tes a wi|ndow (in|
|00004aa0| 63 6c 75 64 69 6e 67 20 | 61 20 6d 6f 64 65 6c 65 |cluding |a modele|
|00004ab0| 73 73 20 64 69 61 6c 6f | 67 20 77 69 6e 64 6f 77 |ss dialo|g window|
|00004ac0| 29 20 69 74 20 6d 75 73 | 74 20 73 65 74 20 74 68 |) it mus|t set th|
|00004ad0| 65 20 77 69 6e 64 6f 77 | 4b 69 6e 64 20 74 6f 20 |e window|Kind to |
|00004ae0| 69 74 73 20 72 65 66 6e | 75 6d d1 61 20 6e 65 67 |its refn|um.a neg|
|00004af0| 61 74 69 76 65 20 6e 75 | 6d 62 65 72 2e 20 57 68 |ative nu|mber. Wh|
|00004b00| 65 6e 20 74 68 65 20 61 | 70 70 6c 69 63 61 74 69 |en the a|pplicati|
|00004b10| 6f 6e 20 63 61 6c 6c 73 | 20 47 65 74 4e 65 78 74 |on calls| GetNext|
|00004b20| 45 76 65 6e 74 2c 20 74 | 68 65 20 45 76 65 6e 74 |Event, t|he Event|
|00004b30| 20 4d 61 6e 61 67 65 72 | 20 63 61 6c 6c 73 20 53 | Manager| calls S|
|00004b40| 79 73 74 65 6d 45 76 65 | 6e 74 2c 20 77 68 69 63 |ystemEve|nt, whic|
|00004b50| 68 20 63 68 65 63 6b 73 | 20 74 6f 20 73 65 65 20 |h checks| to see |
|00004b60| 69 66 20 74 68 65 20 65 | 76 65 6e 74 20 62 65 6c |if the e|vent bel|
|00004b70| 6f 6e 67 73 20 74 6f 20 | 61 20 64 65 73 6b 20 61 |ongs to |a desk a|
|00004b80| 63 63 65 73 73 6f 72 79 | 2e 20 53 79 73 74 65 6d |ccessory|. System|
|00004b90| 45 76 65 6e 74 20 63 68 | 65 63 6b 73 20 74 68 65 |Event ch|ecks the|
|00004ba0| 20 77 69 6e 64 6f 77 4b | 69 6e 64 20 6f 66 20 74 | windowK|ind of t|
|00004bb0| 68 65 20 66 72 6f 6e 74 | 6d 6f 73 74 20 77 69 6e |he front|most win|
|00004bc0| 64 6f 77 2c 20 61 6e 64 | 20 75 73 65 73 20 74 68 |dow, and| uses th|
|00004bd0| 65 20 28 6e 65 67 61 74 | 69 76 65 29 20 6e 75 6d |e (negat|ive) num|
|00004be0| 62 65 72 20 66 6f 72 20 | 74 68 65 20 72 65 66 6e |ber for |the refn|
|00004bf0| 75 6d 20 74 6f 20 6d 61 | 6b 65 20 61 20 63 6f 6e |um to ma|ke a con|
|00004c00| 74 72 6f 6c 20 63 61 6c | 6c 2c 20 67 69 76 69 6e |trol cal|l, givin|
|00004c10| 67 20 74 68 65 20 64 65 | 73 6b 20 61 63 63 65 73 |g the de|sk acces|
|00004c20| 73 6f 72 79 20 61 20 73 | 68 6f 74 20 61 74 20 74 |sory a s|hot at t|
|00004c30| 68 65 20 65 76 65 6e 74 | 2e 20 54 68 65 6e 20 53 |he event|. Then S|
|00004c40| 79 73 74 65 6d 45 76 65 | 6e 74 20 72 65 74 75 72 |ystemEve|nt retur|
|00004c50| 6e 73 20 54 52 55 45 2c | 20 61 6e 64 20 47 65 74 |ns TRUE,| and Get|
|00004c60| 4e 65 78 74 45 76 65 6e | 74 20 72 65 74 75 72 6e |NextEven|t return|
|00004c70| 73 20 46 41 4c 53 45 2e | 0d 53 6f 2c 20 79 6f 75 |s FALSE.|.So, you|
|00004c80| 72 20 64 65 73 6b 20 61 | 63 63 65 73 73 6f 72 79 |r desk a|ccessory|
|00004c90| 20 67 65 74 73 20 61 6e | 20 65 76 65 6e 74 20 66 | gets an| event f|
|00004ca0| 72 6f 6d 20 53 79 73 74 | 65 6d 45 76 65 6e 74 2e |rom Syst|emEvent.|
|00004cb0| 20 53 69 6e 63 65 20 79 | 6f 75 72 20 77 69 6e 64 | Since y|our wind|
|00004cc0| 6f 77 20 69 73 20 61 20 | 6d 6f 64 65 6c 65 73 73 |ow is a |modeless|
|00004cd0| 20 64 69 61 6c 6f 67 2c | 20 79 6f 75 20 63 61 6c | dialog,| you cal|
|00004ce0| 6c 20 49 73 44 69 61 6c | 6f 67 45 76 65 6e 74 2c |l IsDial|ogEvent,|
|00004cf0| 20 77 68 69 63 68 20 6d | 79 73 74 65 72 69 6f 75 | which m|ysteriou|
|00004d00| 73 6c 79 20 72 65 74 75 | 72 6e 73 20 46 41 4c 53 |sly retu|rns FALS|
|00004d10| 45 2e 20 57 68 61 74 20 | 69 73 20 67 6f 69 6e 67 |E. What |is going|
|00004d20| 20 6f 6e 3f 0d 4c 69 6b | 65 20 53 79 73 74 65 6d | on?.Lik|e System|
|00004d30| 45 76 65 6e 74 2c 20 49 | 73 44 69 61 6c 6f 67 45 |Event, I|sDialogE|
|00004d40| 76 65 6e 74 20 63 68 65 | 63 6b 73 20 74 68 65 20 |vent che|cks the |
|00004d50| 77 69 6e 64 6f 77 4b 69 | 6e 64 20 6f 66 20 77 69 |windowKi|nd of wi|
|00004d60| 6e 64 6f 77 73 20 69 6e | 20 74 68 65 20 77 69 6e |ndows in| the win|
|00004d70| 64 6f 77 20 6c 69 73 74 | 2c 20 6c 6f 6f 6b 69 6e |dow list|, lookin|
|00004d80| 67 20 66 6f 72 20 64 69 | 61 6c 6f 67 20 77 69 6e |g for di|alog win|
|00004d90| 64 6f 77 73 2e 20 49 74 | 20 64 6f 65 73 20 74 68 |dows. It| does th|
|00004da0| 69 73 20 62 79 20 6c 6f | 6f 6b 69 6e 67 20 66 6f |is by lo|oking fo|
|00004db0| 72 20 77 69 6e 64 6f 77 | 73 20 77 69 74 68 20 61 |r window|s with a|
|00004dc0| 20 77 69 6e 64 6f 77 4b | 69 6e 64 20 6f 66 20 32 | windowK|ind of 2|
|00004dd0| 2e 20 49 6e 20 74 68 69 | 73 20 63 61 73 65 2c 20 |. In thi|s case, |
|00004de0| 69 74 20 66 69 6e 64 73 | 20 6e 6f 6e 65 2c 20 61 |it finds| none, a|
|00004df0| 6e 64 20 64 6f 65 73 20 | 6e 6f 74 68 69 6e 67 2e |nd does |nothing.|
|00004e00| 0d 54 68 65 20 73 6f 6c | 75 74 69 6f 6e 20 69 73 |.The sol|ution is|
|00004e10| 20 74 6f 20 63 68 61 6e | 67 65 20 74 68 65 20 77 | to chan|ge the w|
|00004e20| 69 6e 64 6f 77 6b 69 6e | 64 20 6f 66 20 79 6f 75 |indowkin|d of you|
|00004e30| 72 20 77 69 6e 64 6f 77 | 20 74 6f 20 32 20 62 65 |r window| to 2 be|
|00004e40| 66 6f 72 65 20 63 61 6c | 6c 69 6e 67 20 49 73 44 |fore cal|ling IsD|
|00004e50| 69 61 6c 6f 67 45 76 65 | 6e 74 2e 20 54 68 69 73 |ialogEve|nt. This|
|00004e60| 20 61 6c 6c 6f 77 73 20 | 74 68 65 20 44 69 61 6c | allows |the Dial|
|00004e70| 6f 67 20 4d 61 6e 61 67 | 65 72 20 74 6f 20 72 65 |og Manag|er to re|
|00004e80| 63 6f 67 6e 69 7a 65 20 | 61 6e 64 20 68 61 6e 64 |cognize |and hand|
|00004e90| 6c 65 20 74 68 65 20 65 | 76 65 6e 74 20 70 72 6f |le the e|vent pro|
|00004ea0| 70 65 72 6c 79 2e 20 42 | 65 66 6f 72 65 20 72 65 |perly. B|efore re|
|00004eb0| 74 75 72 6e 69 6e 67 20 | 74 6f 20 53 79 73 74 65 |turning |to Syste|
|00004ec0| 6d 45 76 65 6e 74 2c 20 | 62 65 20 73 75 72 65 20 |mEvent, |be sure |
|00004ed0| 74 6f 20 72 65 73 74 6f | 72 65 20 74 68 65 20 77 |to resto|re the w|
|00004ee0| 69 6e 64 6f 77 4b 69 6e | 64 2e 20 54 68 61 74 20 |indowKin|d. That |
|00004ef0| 77 61 79 2c 20 77 68 65 | 6e 20 74 68 65 20 61 70 |way, whe|n the ap|
|00004f00| 70 6c 69 63 61 74 69 6f | 6e 20 63 61 6c 6c 73 20 |plicatio|n calls |
|00004f10| 74 68 65 20 44 69 61 6c | 6f 67 20 4d 61 6e 61 67 |the Dial|og Manag|
|00004f20| 65 72 20 77 69 74 68 20 | 74 68 65 20 73 61 6d 65 |er with |the same|
|00004f30| 20 65 76 65 6e 74 20 28 | 74 68 65 20 61 70 70 6c | event (|the appl|
|00004f40| 69 63 61 74 69 6f 6e 20 | 73 68 6f 75 6c 64 20 70 |ication |should p|
|00004f50| 61 73 73 20 61 6c 6c 20 | 65 76 65 6e 74 73 20 74 |ass all |events t|
|00004f60| 6f 20 44 69 61 6c 6f 67 | 20 4d 61 6e 61 67 65 72 |o Dialog| Manager|
|00004f70| 20 69 66 20 69 74 20 68 | 61 73 20 61 6e 79 20 6d | if it h|as any m|
|00004f80| 6f 64 65 6c 65 73 73 20 | 64 69 61 6c 6f 67 73 20 |odeless |dialogs |
|00004f90| 69 74 73 65 6c 66 29 2c | 20 74 68 65 20 44 69 61 |itself),| the Dia|
|00004fa0| 6c 6f 67 20 4d 61 6e 61 | 67 65 72 20 77 69 6c 6c |log Mana|ger will|
|00004fb0| 20 69 67 6e 6f 72 65 20 | 69 74 2e 0d 46 75 72 74 | ignore |it..Furt|
|00004fc0| 68 65 72 20 52 65 66 65 | 72 65 6e 63 65 3a 0d 09 |her Refe|rence:..|
|00004fd0| a5 09 54 68 65 20 54 6f | 6f 6c 62 6f 78 20 45 76 |..The To|olbox Ev|
|00004fe0| 65 6e 74 20 4d 61 6e 61 | 67 65 0d 09 a5 09 54 68 |ent Mana|ge....Th|
|00004ff0| 65 20 44 69 61 6c 6f 67 | 20 4d 61 6e 61 67 65 72 |e Dialog| Manager|
|00005000| 0d 09 a5 09 54 68 65 20 | 44 65 73 6b 20 4d 61 6e |....The |Desk Man|
|00005010| 61 67 65 72 09 0d 4e 6f | 74 69 66 69 63 61 74 69 |ager..No|tificati|
|00005020| 6f 6e 20 4d 61 6e 61 67 | 65 72 20 51 26 41 73 0d |on Manag|er Q&As.|
|00005030| 50 72 6f 63 65 73 73 65 | 73 09 4d 2e 50 53 2e 4e |Processe|s.M.PS.N|
|00005040| 6f 74 69 66 4d 67 72 2e | 51 26 41 73 0d 52 65 76 |otifMgr.|Q&As.Rev|
|00005050| 69 73 65 64 20 62 79 3a | 09 44 65 76 65 6c 6f 70 |ised by:|.Develop|
|00005060| 65 72 20 53 75 70 70 6f | 72 74 20 43 65 6e 74 65 |er Suppo|rt Cente|
|00005070| 72 09 4f 63 74 6f 62 65 | 72 20 31 39 39 32 0d 57 |r.Octobe|r 1992.W|
|00005080| 72 69 74 74 65 6e 20 62 | 79 3a 09 44 65 76 65 6c |ritten b|y:.Devel|
|00005090| 6f 70 65 72 20 53 75 70 | 70 6f 72 74 20 43 65 6e |oper Sup|port Cen|
|000050a0| 74 65 72 09 4f 63 74 6f | 62 65 72 20 31 39 39 30 |ter.Octo|ber 1990|
|000050b0| 0d 54 68 69 73 20 54 65 | 63 68 6e 69 63 61 6c 20 |.This Te|chnical |
|000050c0| 4e 6f 74 65 20 63 6f 6e | 74 61 69 6e 73 20 61 20 |Note con|tains a |
|000050d0| 63 6f 6c 6c 65 63 74 69 | 6f 6e 20 6f 66 20 51 26 |collecti|on of Q&|
|000050e0| 41 73 20 72 65 6c 61 74 | 69 6e 67 20 74 6f 20 61 |As relat|ing to a|
|000050f0| 20 73 70 65 63 69 66 69 | 63 20 74 6f 70 69 63 d1 | specifi|c topic.|
|00005100| 71 75 65 73 74 69 6f 6e | 73 20 79 6f 75 d5 76 65 |question|s you.ve|
|00005110| 20 73 65 6e 74 20 74 68 | 65 20 44 65 76 65 6c 6f | sent th|e Develo|
|00005120| 70 65 72 20 53 75 70 70 | 6f 72 74 20 43 65 6e 74 |per Supp|ort Cent|
|00005130| 65 72 20 28 44 53 43 29 | 20 61 6c 6f 6e 67 20 77 |er (DSC)| along w|
|00005140| 69 74 68 20 61 6e 73 77 | 65 72 73 20 66 72 6f 6d |ith answ|ers from|
|00005150| 20 74 68 65 20 44 53 43 | 20 65 6e 67 69 6e 65 65 | the DSC| enginee|
|00005160| 72 73 2e 20 57 68 69 6c | 65 20 44 53 43 20 65 6e |rs. Whil|e DSC en|
|00005170| 67 69 6e 65 65 72 73 20 | 68 61 76 65 20 63 68 65 |gineers |have che|
|00005180| 63 6b 65 64 20 74 68 65 | 20 51 26 41 20 63 6f 6e |cked the| Q&A con|
|00005190| 74 65 6e 74 20 66 6f 72 | 20 61 63 63 75 72 61 63 |tent for| accurac|
|000051a0| 79 2c 20 74 68 65 20 51 | 26 41 20 54 65 63 68 6e |y, the Q|&A Techn|
|000051b0| 69 63 61 6c 20 4e 6f 74 | 65 73 20 64 6f 6e d5 74 |ical Not|es don.t|
|000051c0| 20 68 61 76 65 20 74 68 | 65 20 65 64 69 74 69 6e | have th|e editin|
|000051d0| 67 20 61 6e 64 20 6f 72 | 67 61 6e 69 7a 61 74 69 |g and or|ganizati|
|000051e0| 6f 6e 20 6f 66 20 6f 74 | 68 65 72 20 54 65 63 68 |on of ot|her Tech|
|000051f0| 6e 69 63 61 6c 20 4e 6f | 74 65 73 2e 20 54 68 65 |nical No|tes. The|
|00005200| 20 51 26 41 20 66 75 6e | 63 74 69 6f 6e 20 69 73 | Q&A fun|ction is|
|00005210| 20 74 6f 20 67 65 74 20 | 6e 65 77 20 74 65 63 68 | to get |new tech|
|00005220| 6e 69 63 61 6c 20 69 6e | 66 6f 72 6d 61 74 69 6f |nical in|formatio|
|00005230| 6e 20 61 6e 64 20 75 70 | 64 61 74 65 73 20 74 6f |n and up|dates to|
|00005240| 20 79 6f 75 20 71 75 69 | 63 6b 6c 79 2c 20 73 61 | you qui|ckly, sa|
|00005250| 76 69 6e 67 20 74 68 65 | 20 70 6f 6c 69 73 68 20 |ving the| polish |
|00005260| 66 6f 72 20 77 68 65 6e | 20 74 68 65 20 69 6e 66 |for when| the inf|
|00005270| 6f 72 6d 61 74 69 6f 6e | 20 6d 69 67 72 61 74 65 |ormation| migrate|
|00005280| 73 20 69 6e 74 6f 20 72 | 65 66 65 72 65 6e 63 65 |s into r|eference|
|00005290| 20 6d 61 6e 75 61 6c 73 | 2e 0d 51 26 41 73 20 61 | manuals|..Q&As a|
|000052a0| 72 65 20 6e 6f 77 20 69 | 6e 63 6c 75 64 65 64 20 |re now i|ncluded |
|000052b0| 77 69 74 68 20 54 65 63 | 68 6e 69 63 61 6c 20 4e |with Tec|hnical N|
|000052c0| 6f 74 65 73 20 74 6f 20 | 6d 61 6b 65 20 61 63 63 |otes to |make acc|
|000052d0| 65 73 73 20 74 6f 20 74 | 65 63 68 6e 69 63 61 6c |ess to t|echnical|
|000052e0| 20 75 70 64 61 74 65 73 | 20 65 61 73 69 65 72 20 | updates| easier |
|000052f0| 66 6f 72 20 79 6f 75 2e | 20 49 66 20 79 6f 75 20 |for you.| If you |
|00005300| 68 61 76 65 20 63 6f 6d | 6d 65 6e 74 73 20 6f 72 |have com|ments or|
|00005310| 20 73 75 67 67 65 73 74 | 69 6f 6e 73 20 61 62 6f | suggest|ions abo|
|00005320| 75 74 20 51 26 41 20 63 | 6f 6e 74 65 6e 74 20 6f |ut Q&A c|ontent o|
|00005330| 72 20 64 69 73 74 72 69 | 62 75 74 69 6f 6e 2c 20 |r distri|bution, |
|00005340| 70 6c 65 61 73 65 20 6c | 65 74 20 75 73 20 6b 6e |please l|et us kn|
|00005350| 6f 77 20 62 79 20 73 65 | 6e 64 69 6e 67 20 61 6e |ow by se|nding an|
|00005360| 20 41 70 70 6c 65 4c 69 | 6e 6b 20 74 6f 20 44 45 | AppleLi|nk to DE|
|00005370| 56 46 45 45 44 42 41 43 | 4b 2e 20 41 70 70 6c 65 |VFEEDBAC|K. Apple|
|00005380| 20 50 61 72 74 6e 65 72 | 73 20 6d 61 79 20 73 65 | Partner|s may se|
|00005390| 6e 64 20 74 65 63 68 6e | 69 63 61 6c 20 71 75 65 |nd techn|ical que|
|000053a0| 73 74 69 6f 6e 73 20 61 | 62 6f 75 74 20 51 26 41 |stions a|bout Q&A|
|000053b0| 20 63 6f 6e 74 65 6e 74 | 20 74 6f 20 44 45 56 53 | content| to DEVS|
|000053c0| 55 50 50 4f 52 54 20 66 | 6f 72 20 72 65 73 6f 6c |UPPORT f|or resol|
|000053d0| 75 74 69 6f 6e 2e 0d 4e | 65 77 20 51 26 41 73 20 |ution..N|ew Q&As |
|000053e0| 61 6e 64 20 51 26 41 73 | 20 72 65 76 69 73 65 64 |and Q&As| revised|
|000053f0| 20 74 68 69 73 20 6d 6f | 6e 74 68 20 61 72 65 20 | this mo|nth are |
|00005400| 6d 61 72 6b 65 64 20 77 | 69 74 68 20 61 20 62 61 |marked w|ith a ba|
|00005410| 72 20 69 6e 20 74 68 65 | 20 73 69 64 65 20 6d 61 |r in the| side ma|
|00005420| 72 67 69 6e 2e 0d 4d 61 | 63 69 6e 74 6f 73 68 20 |rgin..Ma|cintosh |
|00005430| 62 61 63 6b 67 72 6f 75 | 6e 64 20 44 41 20 61 6c |backgrou|nd DA al|
|00005440| 65 72 74 73 0d 57 72 69 | 74 74 65 6e 3a 09 36 2f |erts.Wri|tten:.6/|
|00005450| 31 30 2f 39 31 0d 4c 61 | 73 74 20 72 65 76 69 65 |10/91.La|st revie|
|00005460| 77 65 64 3a 09 38 2f 31 | 2f 39 32 0d 48 6f 77 20 |wed:.8/1|/92.How |
|00005470| 63 61 6e 20 49 20 75 73 | 65 20 74 68 65 20 4e 6f |can I us|e the No|
|00005480| 74 69 66 69 63 61 74 69 | 6f 6e 20 4d 61 6e 61 67 |tificati|on Manag|
|00005490| 65 72 20 74 6f 20 61 6c | 65 72 74 20 74 68 65 20 |er to al|ert the |
|000054a0| 75 73 65 72 20 74 6f 20 | 62 72 69 6e 67 20 6d 79 |user to |bring my|
|000054b0| 20 44 41 20 74 6f 20 74 | 68 65 20 66 72 6f 6e 74 | DA to t|he front|
|000054c0| 20 61 6e 64 20 74 68 65 | 6e 20 64 69 73 70 6c 61 | and the|n displa|
|000054d0| 79 20 61 6e 20 61 6c 65 | 72 74 3f 0d 5f 5f 5f 0d |y an ale|rt?.___.|
|000054e0| 42 61 73 69 63 61 6c 6c | 79 2c 20 69 66 20 79 6f |Basicall|y, if yo|
|000054f0| 75 72 20 44 41 20 69 73 | 20 69 6e 20 74 68 65 20 |ur DA is| in the |
|00005500| 66 6f 72 65 67 72 6f 75 | 6e 64 20 61 6e 64 20 79 |foregrou|nd and y|
|00005510| 6f 75 20 66 69 6e 69 73 | 68 20 79 6f 75 72 20 74 |ou finis|h your t|
|00005520| 61 73 6b 2c 20 79 6f 75 | 20 63 61 6e 20 6a 75 73 |ask, you| can jus|
|00005530| 74 20 75 73 65 20 41 6c | 65 72 74 28 29 20 74 6f |t use Al|ert() to|
|00005540| 20 6e 6f 74 69 66 79 20 | 74 68 65 20 75 73 65 72 | notify |the user|
|00005550| 2e 20 49 66 20 79 6f 75 | 72 20 44 41 20 69 73 20 |. If you|r DA is |
|00005560| 69 6e 20 74 68 65 20 62 | 61 63 6b 67 72 6f 75 6e |in the b|ackgroun|
|00005570| 64 20 77 68 65 6e 20 69 | 74 20 66 69 6e 69 73 68 |d when i|t finish|
|00005580| 65 73 2c 20 70 6f 73 74 | 20 61 20 6e 6f 74 69 66 |es, post| a notif|
|00005590| 69 63 61 74 69 6f 6e 20 | 77 69 74 68 20 4e 4d 49 |ication |with NMI|
|000055a0| 6e 73 74 61 6c 6c 20 74 | 68 61 74 20 6e 6f 74 69 |nstall t|hat noti|
|000055b0| 66 69 65 73 20 74 68 65 | 20 75 73 65 72 20 62 79 |fies the| user by|
|000055c0| 20 73 6f 75 6e 64 2c 20 | 69 63 6f 6e 2c 20 61 6e | sound, |icon, an|
|000055d0| 64 20 6d 61 72 6b 20 69 | 6e 20 74 68 65 20 70 72 |d mark i|n the pr|
|000055e0| 6f 63 65 73 73 20 6d 65 | 6e 75 20 28 62 75 74 20 |ocess me|nu (but |
|000055f0| 6e 6f 74 20 61 6e 20 61 | 6c 65 72 74 29 20 74 68 |not an a|lert) th|
|00005600| 61 74 20 73 6f 6d 65 74 | 68 69 6e 67 20 69 73 20 |at somet|hing is |
|00005610| 75 70 20 69 6e 20 79 6f | 75 72 20 64 65 73 6b 20 |up in yo|ur desk |
|00005620| 61 63 63 65 73 73 6f 72 | 79 2e 20 57 68 65 6e 20 |accessor|y. When |
|00005630| 74 68 65 79 20 73 77 69 | 74 63 68 20 74 6f 20 79 |they swi|tch to y|
|00005640| 6f 75 72 20 44 41 2c 20 | 79 6f 75 20 74 68 65 6e |our DA, |you then|
|00005650| 20 64 69 73 70 6c 61 79 | 20 79 6f 75 72 20 61 6c | display| your al|
|00005660| 65 72 74 2e 0d 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |ert..The| followi|
|00005670| 6e 67 20 63 6f 64 65 20 | 69 73 20 66 6f 72 20 61 |ng code |is for a|
|00005680| 20 44 41 20 77 72 69 74 | 74 65 6e 20 69 6e 20 54 | DA writ|ten in T|
|00005690| 68 69 6e 6b 20 43 20 74 | 68 61 74 20 6e 6f 74 69 |hink C t|hat noti|
|000056a0| 66 69 65 73 20 74 68 65 | 20 75 73 65 72 20 61 73 |fies the| user as|
|000056b0| 20 64 65 73 63 72 69 62 | 65 64 20 61 62 6f 76 65 | describ|ed above|
|000056c0| 2e 20 50 6f 72 74 69 6f | 6e 73 20 6f 66 20 74 68 |. Portio|ns of th|
|000056d0| 65 20 63 6f 64 65 20 61 | 72 65 20 62 6f 72 72 6f |e code a|re borro|
|000056e0| 77 65 64 20 66 72 6f 6d | 20 74 68 65 20 54 68 69 |wed from| the Thi|
|000056f0| 6e 6b 20 43 20 65 78 61 | 6d 70 6c 65 20 d2 48 65 |nk C exa|mple .He|
|00005700| 78 20 44 75 6d 70 20 44 | 41 2e d3 20 42 61 73 69 |x Dump D|A.. Basi|
|00005710| 63 61 6c 6c 79 2c 20 74 | 68 69 73 20 63 6f 64 65 |cally, t|his code|
|00005720| 20 6b 65 65 70 73 20 74 | 72 61 63 6b 20 6f 66 20 | keeps t|rack of |
|00005730| 77 68 65 74 68 65 72 20 | 74 68 65 20 44 41 20 69 |whether |the DA i|
|00005740| 73 20 69 6e 20 74 68 65 | 20 66 6f 72 65 67 72 6f |s in the| foregro|
|00005750| 75 6e 64 20 6f 72 20 62 | 61 63 6b 67 72 6f 75 6e |und or b|ackgroun|
|00005760| 64 20 62 79 20 73 65 74 | 74 69 6e 67 20 74 68 65 |d by set|ting the|
|00005770| 20 67 6c 6f 62 61 6c 20 | 76 61 72 69 61 62 6c 65 | global |variable|
|00005780| 20 67 49 6e 42 61 63 6b | 67 72 6f 75 6e 64 20 61 | gInBack|ground a|
|00005790| 74 20 65 76 65 72 79 20 | 61 63 74 69 76 61 74 65 |t every |activate|
|000057a0| 20 61 6e 64 20 64 65 61 | 63 74 69 76 61 74 65 20 | and dea|ctivate |
|000057b0| 65 76 65 6e 74 2e 20 49 | 66 20 74 68 65 72 65 20 |event. I|f there |
|000057c0| 69 73 20 61 20 6e 6f 74 | 69 66 69 63 61 74 69 6f |is a not|ificatio|
|000057d0| 6e 20 70 65 6e 64 69 6e | 67 20 61 6e 64 20 61 6e |n pendin|g and an|
|000057e0| 20 61 63 74 69 76 61 74 | 65 20 65 76 65 6e 74 20 | activat|e event |
|000057f0| 69 73 20 72 65 63 65 69 | 76 65 64 2c 20 74 68 65 |is recei|ved, the|
|00005800| 20 72 6f 75 74 69 6e 65 | 20 4d 79 52 65 73 70 6f | routine| MyRespo|
|00005810| 6e 73 65 20 69 73 20 63 | 61 6c 6c 65 64 20 74 6f |nse is c|alled to|
|00005820| 20 72 65 6d 6f 76 65 20 | 74 68 65 20 6e 6f 74 69 | remove |the noti|
|00005830| 66 69 63 61 74 69 6f 6e | 20 61 6e 64 20 64 69 73 |fication| and dis|
|00005840| 70 6c 61 79 20 74 68 65 | 20 61 70 70 72 6f 70 72 |play the| appropr|
|00005850| 69 61 74 65 20 61 6c 65 | 72 74 2e 0d 4e 6f 74 65 |iate ale|rt..Note|
|00005860| 20 74 68 61 74 20 66 6f | 72 20 4d 50 57 20 79 6f | that fo|r MPW yo|
|00005870| 75 d5 6c 6c 20 68 61 76 | 65 20 74 6f 20 73 74 6f |u.ll hav|e to sto|
|00005880| 72 65 20 79 6f 75 72 20 | 67 6c 6f 62 61 6c 73 20 |re your |globals |
|00005890| 65 6c 73 65 77 68 65 72 | 65 2c 20 61 73 20 4d 50 |elsewher|e, as MP|
|000058a0| 57 20 64 6f 65 73 6e d5 | 74 20 70 72 6f 76 69 64 |W doesn.|t provid|
|000058b0| 65 20 74 68 65 20 54 68 | 69 6e 6b 20 43 20 41 34 |e the Th|ink C A4|
|000058c0| 20 66 65 61 74 75 72 65 | 2e 20 59 6f 75 d5 6c 6c | feature|. You.ll|
|000058d0| 20 68 61 76 65 20 74 6f | 20 6d 6f 64 69 66 79 20 | have to| modify |
|000058e0| 74 68 65 20 63 6f 64 65 | 20 74 6f 20 77 6f 72 6b |the code| to work|
|000058f0| 20 77 69 74 68 20 79 6f | 75 72 20 66 75 6e 63 74 | with yo|ur funct|
|00005900| 69 6f 6e 20 74 6f 20 67 | 65 74 20 74 68 65 20 70 |ion to g|et the p|
|00005910| 72 6f 70 65 72 20 72 65 | 73 6f 75 72 63 65 20 49 |roper re|source I|
|00005920| 44 73 2e 0d 76 6f 69 64 | 20 50 6f 73 74 4e 6f 74 |Ds..void| PostNot|
|00005930| 69 66 79 28 53 74 72 69 | 6e 67 50 74 72 20 74 68 |ify(Stri|ngPtr th|
|00005940| 65 53 74 72 29 0d 7b 0d | 20 20 20 20 65 78 74 65 |eStr).{.| exte|
|00005950| 72 6e 20 42 6f 6f 6c 65 | 61 6e 20 67 49 6e 42 61 |rn Boole|an gInBa|
|00005960| 63 6b 67 72 6f 75 6e 64 | 3b 20 20 20 20 2f 2a 20 |ckground|; /* |
|00005970| 74 72 75 65 3d 69 6e 20 | 62 61 63 6b 67 72 6f 75 |true=in |backgrou|
|00005980| 6e 64 20 2a 2f 0d 20 20 | 20 20 65 78 74 65 72 6e |nd */. | extern|
|00005990| 20 4e 4d 52 65 63 20 2a | 67 4e 6f 74 69 66 79 3b | NMRec *|gNotify;|
|000059a0| 20 20 20 2f 2a 20 67 6c | 6f 62 61 6c 20 76 61 72 | /* gl|obal var|
|000059b0| 20 70 6f 69 6e 74 69 6e | 67 20 74 6f 20 6e 6f 74 | pointin|g to not|
|000059c0| 69 66 2e 20 72 65 63 20 | 30 3d 6e 6f 6e 65 20 2a |if. rec |0=none *|
|000059d0| 2f 0d 20 20 20 20 48 61 | 6e 64 6c 65 20 6e 6f 74 |/. Ha|ndle not|
|000059e0| 49 63 6f 6e 3b 0d 20 20 | 20 20 50 74 72 20 74 78 |Icon;. | Ptr tx|
|000059f0| 74 50 74 72 3b 0d 20 20 | 20 0d 20 20 20 20 2f 2a |tPtr;. | . /*|
|00005a00| 20 62 6c 61 73 74 20 61 | 77 61 79 20 61 6e 79 20 | blast a|way any |
|00005a10| 6f 74 68 65 72 20 70 65 | 6e 64 69 6e 67 20 6e 6f |other pe|nding no|
|00005a20| 74 69 66 69 63 61 74 69 | 6f 6e 20 2a 2f 0d 20 20 |tificati|on */. |
|00005a30| 20 0d 20 20 20 20 69 66 | 20 28 67 4e 6f 74 69 66 | . if| (gNotif|
|00005a40| 79 29 20 7b 0d 20 20 20 | 20 20 20 20 20 44 69 73 |y) {. | Dis|
|00005a50| 70 6f 73 50 74 72 28 28 | 50 74 72 29 20 67 4e 6f |posPtr((|Ptr) gNo|
|00005a60| 74 69 66 79 2d 3e 6e 6d | 52 65 66 43 6f 6e 29 3b |tify->nm|RefCon);|
|00005a70| 0d 20 20 20 20 20 20 20 | 20 4e 4d 52 65 6d 6f 76 |. | NMRemov|
|00005a80| 65 28 67 4e 6f 74 69 66 | 79 29 3b 0d 20 20 20 20 |e(gNotif|y);. |
|00005a90| 20 20 20 20 67 4e 6f 74 | 69 66 79 20 3d 20 6e 69 | gNot|ify = ni|
|00005aa0| 6c 3b 0d 20 20 20 20 7d | 0d 20 20 20 0d 20 20 20 |l;. }|. . |
|00005ab0| 20 2f 2a 20 73 65 65 20 | 69 66 20 77 65 20 73 68 | /* see |if we sh|
|00005ac0| 6f 75 6c 64 20 6e 6f 74 | 69 66 79 20 6f 72 20 75 |ould not|ify or u|
|00005ad0| 73 65 20 61 6c 65 72 74 | 20 2a 2f 0d 20 20 20 0d |se alert| */. .|
|00005ae0| 20 20 20 20 69 66 20 28 | 67 49 6e 42 61 63 6b 67 | if (|gInBackg|
|00005af0| 72 6f 75 6e 64 29 20 7b | 0d 20 20 20 0d 20 20 20 |round) {|. . |
|00005b00| 20 20 20 20 20 2f 2a 20 | 61 6c 6c 6f 63 61 74 65 | /* |allocate|
|00005b10| 20 6d 65 6d 6f 72 79 20 | 66 6f 72 20 6e 6f 74 69 | memory |for noti|
|00005b20| 66 69 63 61 74 69 6f 6e | 20 2a 2f 0d 20 20 20 20 |fication| */. |
|00005b30| 20 20 20 0d 20 20 20 20 | 20 20 20 20 74 78 74 50 | . | txtP|
|00005b40| 74 72 20 3d 20 4e 65 77 | 50 74 72 28 73 69 7a 65 |tr = New|Ptr(size|
|00005b50| 6f 66 28 53 74 72 32 35 | 35 29 29 3b 0d 20 20 20 |of(Str25|5));. |
|00005b60| 20 20 20 20 20 69 66 20 | 28 4d 65 6d 45 72 72 6f | if |(MemErro|
|00005b70| 72 28 29 21 3d 6e 6f 45 | 72 72 29 0d 20 20 20 20 |r()!=noE|rr). |
|00005b80| 20 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 3b 0d | |return;.|
|00005b90| 20 20 20 20 20 20 20 20 | 67 4e 6f 74 69 66 79 20 | |gNotify |
|00005ba0| 3d 20 28 4e 4d 52 65 63 | 20 2a 29 4e 65 77 50 74 |= (NMRec| *)NewPt|
|00005bb0| 72 28 73 69 7a 65 6f 66 | 28 4e 4d 52 65 63 29 29 |r(sizeof|(NMRec))|
|00005bc0| 3b 0d 20 20 20 20 20 20 | 20 20 69 66 20 28 4d 65 |;. | if (Me|
|00005bd0| 6d 45 72 72 6f 72 28 29 | 21 3d 6e 6f 45 72 72 29 |mError()|!=noErr)|
|00005be0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 72 65 74 |. | ret|
|00005bf0| 75 72 6e 3b 0d 20 20 20 | 20 20 20 20 0d 20 20 20 |urn;. | . |
|00005c00| 20 20 20 20 20 2f 2a 20 | 63 6f 70 79 20 6e 6f 74 | /* |copy not|
|00005c10| 69 66 2e 20 73 74 72 69 | 6e 67 20 74 6f 20 64 79 |if. stri|ng to dy|
|00005c20| 6e 61 6d 69 63 61 6c 6c | 79 20 61 6c 6c 6f 63 61 |namicall|y alloca|
|00005c30| 74 65 64 20 62 6c 6f 63 | 6b 20 2a 2f 0d 20 20 20 |ted bloc|k */. |
|00005c40| 20 20 20 20 0d 20 20 20 | 20 20 20 20 20 42 6c 6f | . | Blo|
|00005c50| 63 6b 4d 6f 76 65 28 74 | 68 65 53 74 72 2c 74 78 |ckMove(t|heStr,tx|
|00005c60| 74 50 74 72 2c 32 35 36 | 29 3b 0d 20 20 20 20 20 |tPtr,256|);. |
|00005c70| 20 20 0d 20 20 20 20 20 | 20 20 20 2f 2a 20 66 69 | . | /* fi|
|00005c80| 6c 6c 20 6f 75 74 20 6e | 6f 74 69 66 2e 20 72 65 |ll out n|otif. re|
|00005c90| 63 6f 72 64 20 2a 2f 0d | 20 20 20 20 20 20 20 0d |cord */.| .|
|00005ca0| 20 20 20 20 20 20 20 20 | 6e 6f 74 49 63 6f 6e 20 | |notIcon |
|00005cb0| 3d 20 47 65 74 52 65 73 | 6f 75 72 63 65 28 27 53 |= GetRes|ource('S|
|00005cc0| 49 43 4e 27 2c 4f 77 6e | 65 64 52 65 73 6f 75 72 |ICN',Own|edResour|
|00005cd0| 63 65 49 44 28 4e 4f 54 | 49 46 5f 49 43 4f 4e 29 |ceID(NOT|IF_ICON)|
|00005ce0| 29 3b 0d 20 20 20 20 20 | 20 20 20 67 4e 6f 74 69 |);. | gNoti|
|00005cf0| 66 79 2d 3e 6e 6d 53 74 | 72 20 3d 20 6e 69 6c 3b |fy->nmSt|r = nil;|
|00005d00| 0d 20 20 20 20 20 20 20 | 20 67 4e 6f 74 69 66 79 |. | gNotify|
|00005d10| 2d 3e 71 54 79 70 65 20 | 3d 20 6e 6d 54 79 70 65 |->qType |= nmType|
|00005d20| 3b 0d 20 20 20 20 20 20 | 20 20 67 4e 6f 74 69 66 |;. | gNotif|
|00005d30| 79 2d 3e 6e 6d 4d 61 72 | 6b 20 3d 20 31 3b 0d 20 |y->nmMar|k = 1;. |
|00005d40| 20 20 20 20 20 20 20 67 | 4e 6f 74 69 66 79 2d 3e | g|Notify->|
|00005d50| 6e 6d 49 63 6f 6e 20 3d | 20 6e 6f 74 49 63 6f 6e |nmIcon =| notIcon|
|00005d60| 3b 0d 20 20 20 20 20 20 | 20 20 67 4e 6f 74 69 66 |;. | gNotif|
|00005d70| 79 2d 3e 6e 6d 53 6f 75 | 6e 64 20 3d 20 28 48 61 |y->nmSou|nd = (Ha|
|00005d80| 6e 64 6c 65 29 2d 31 3b | 0d 20 20 20 20 20 20 20 |ndle)-1;|. |
|00005d90| 20 67 4e 6f 74 69 66 79 | 2d 3e 6e 6d 52 65 73 70 | gNotify|->nmResp|
|00005da0| 20 3d 20 6e 69 6c 3b 0d | 20 20 20 20 20 20 20 20 | = nil;.| |
|00005db0| 67 4e 6f 74 69 66 79 2d | 3e 6e 6d 52 65 66 43 6f |gNotify-|>nmRefCo|
|00005dc0| 6e 20 3d 20 28 6c 6f 6e | 67 29 74 78 74 50 74 72 |n = (lon|g)txtPtr|
|00005dd0| 3b 0d 20 20 20 20 20 20 | 20 0d 20 20 20 20 20 20 |;. | . |
|00005de0| 20 20 4e 4d 49 6e 73 74 | 61 6c 6c 28 67 4e 6f 74 | NMInst|all(gNot|
|00005df0| 69 66 79 29 3b 0d 20 20 | 20 20 7d 0d 20 20 20 20 |ify);. | }. |
|00005e00| 65 6c 73 65 20 7b 0d 20 | 20 20 20 20 20 20 20 50 |else {. | P|
|00005e10| 61 72 61 6d 54 65 78 74 | 28 74 68 65 53 74 72 2c |aramText|(theStr,|
|00005e20| 22 5c 70 22 2c 22 5c 70 | 22 2c 22 5c 70 22 29 3b |"\p","\p|","\p");|
|00005e30| 0d 20 20 20 20 20 20 20 | 20 53 74 6f 70 41 6c 65 |. | StopAle|
|00005e40| 72 74 28 4f 77 6e 65 64 | 52 65 73 6f 75 72 63 65 |rt(Owned|Resource|
|00005e50| 49 44 28 41 4c 45 52 54 | 5f 44 49 41 4c 4f 47 29 |ID(ALERT|_DIALOG)|
|00005e60| 2c 6e 69 6c 29 3b 0d 20 | 20 20 20 7d 0d 7d 0d 2f |,nil);. | }.}./|
|00005e70| 2a 20 72 65 73 70 6f 6e | 73 65 20 70 72 6f 63 65 |* respon|se proce|
|00005e80| 64 75 72 65 2d 2d 20 63 | 61 6c 6c 65 64 20 6f 6e |dure-- c|alled on|
|00005e90| 20 61 63 74 69 76 61 74 | 65 45 76 74 20 2a 2f 0d | activat|eEvt */.|
|00005ea0| 70 61 73 63 61 6c 20 76 | 6f 69 64 20 4d 79 52 65 |pascal v|oid MyRe|
|00005eb0| 73 70 6f 6e 73 65 28 51 | 45 6c 65 6d 50 74 72 20 |sponse(Q|ElemPtr |
|00005ec0| 6e 6d 52 65 71 50 74 72 | 29 0d 7b 0d 20 20 20 20 |nmReqPtr|).{. |
|00005ed0| 53 74 72 69 6e 67 50 74 | 72 20 65 72 72 54 78 74 |StringPt|r errTxt|
|00005ee0| 3b 0d 20 20 20 0d 20 20 | 20 20 65 72 72 54 78 74 |;. . | errTxt|
|00005ef0| 20 3d 20 28 53 74 72 69 | 6e 67 50 74 72 29 20 28 | = (Stri|ngPtr) (|
|00005f00| 28 4e 4d 52 65 63 20 2a | 29 6e 6d 52 65 71 50 74 |(NMRec *|)nmReqPt|
|00005f10| 72 29 2d 3e 6e 6d 52 65 | 66 43 6f 6e 3b 0d 20 20 |r)->nmRe|fCon;. |
|00005f20| 20 20 4e 4d 52 65 6d 6f | 76 65 28 28 4e 4d 52 65 | NMRemo|ve((NMRe|
|00005f30| 63 20 2a 29 6e 6d 52 65 | 71 50 74 72 29 3b 0d 20 |c *)nmRe|qPtr);. |
|00005f40| 20 20 0d 20 20 20 20 50 | 61 72 61 6d 54 65 78 74 | . P|aramText|
|00005f50| 28 65 72 72 54 78 74 2c | 22 5c 70 22 2c 22 5c 70 |(errTxt,|"\p","\p|
|00005f60| 22 2c 22 5c 70 22 29 3b | 0d 20 20 20 20 53 74 6f |","\p");|. Sto|
|00005f70| 70 41 6c 65 72 74 28 4f | 77 6e 65 64 52 65 73 6f |pAlert(O|wnedReso|
|00005f80| 75 72 63 65 49 44 28 41 | 4c 45 52 54 5f 44 49 41 |urceID(A|LERT_DIA|
|00005f90| 4c 4f 47 29 2c 6e 69 6c | 29 3b 0d 20 20 20 0d 20 |LOG),nil|);. . |
|00005fa0| 20 20 20 44 69 73 70 6f | 73 50 74 72 28 65 72 72 | Dispo|sPtr(err|
|00005fb0| 54 78 74 29 3b 0d 7d 0d | 2f 2a 2d 2d 2d 2d 2d 2d |Txt);.}.|/*------|
|00005fc0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005fd0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005fe0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005ff0| 2d 2d 2d 2a 2f 0d 20 20 | 68 65 72 65 27 73 20 74 |---*/. |here's t|
|00006000| 68 65 20 70 69 65 63 65 | 20 6f 66 20 74 68 65 20 |he piece| of the |
|00006010| 63 6f 64 65 20 74 68 61 | 74 20 68 61 6e 64 6c 65 |code tha|t handle|
|00006020| 73 20 61 63 74 69 76 61 | 74 65 20 65 76 65 6e 74 |s activa|te event|
|00006030| 73 0d 2f 2a 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |s./*----|--------|
|00006040| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006050| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006060| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2a 2f 0d |--------|-----*/.|
|00006070| 64 6f 41 63 74 69 76 61 | 74 65 28 61 63 74 69 76 |doActiva|te(activ|
|00006080| 61 74 65 29 0d 42 6f 6f | 6c 65 61 6e 20 61 63 74 |ate).Boo|lean act|
|00006090| 69 76 61 74 65 3b 0d 7b | 0d 20 20 20 20 65 78 74 |ivate;.{|. ext|
|000060a0| 65 72 6e 20 42 6f 6f 6c | 65 61 6e 20 67 49 6e 42 |ern Bool|ean gInB|
|000060b0| 61 63 6b 67 72 6f 75 6e | 64 3b 0d 20 20 20 20 65 |ackgroun|d;. e|
|000060c0| 78 74 65 72 6e 20 4e 4d | 52 65 63 20 2a 67 4e 6f |xtern NM|Rec *gNo|
|000060d0| 74 69 66 79 3b 0d 20 20 | 20 20 52 65 63 74 20 72 |tify;. | Rect r|
|000060e0| 3b 0d 20 20 20 20 47 72 | 61 66 50 74 72 20 20 20 |;. Gr|afPtr |
|000060f0| 20 73 61 76 65 50 6f 72 | 74 3b 0d 20 20 20 20 20 | savePor|t;. |
|00006100| 20 20 0d 20 20 20 20 47 | 65 74 50 6f 72 74 28 26 | . G|etPort(&|
|00006110| 73 61 76 65 50 6f 72 74 | 29 3b 0d 20 20 20 20 53 |savePort|);. S|
|00006120| 65 74 50 6f 72 74 28 77 | 70 29 3b 0d 20 20 20 20 |etPort(w|p);. |
|00006130| 72 20 3d 20 77 70 2d 3e | 70 6f 72 74 52 65 63 74 |r = wp->|portRect|
|00006140| 3b 0d 20 20 20 20 72 2e | 74 6f 70 20 3d 20 72 2e |;. r.|top = r.|
|00006150| 62 6f 74 74 6f 6d 20 2d | 20 31 36 3b 0d 20 20 20 |bottom -| 16;. |
|00006160| 20 72 2e 6c 65 66 74 20 | 3d 20 72 2e 6c 65 66 74 | r.left |= r.left|
|00006170| 20 2d 20 31 36 3b 0d 20 | 20 20 20 49 6e 76 61 6c | - 16;. | Inval|
|00006180| 52 65 63 74 28 26 72 29 | 3b 0d 20 20 20 20 67 49 |Rect(&r)|;. gI|
|00006190| 6e 42 61 63 6b 67 72 6f | 75 6e 64 20 3d 20 21 61 |nBackgro|und = !a|
|000061a0| 63 74 69 76 61 74 65 3b | 0d 20 20 20 20 69 66 20 |ctivate;|. if |
|000061b0| 28 20 61 63 74 69 76 61 | 74 65 20 29 20 7b 0d 20 |( activa|te ) {. |
|000061c0| 20 20 20 20 20 20 20 69 | 66 20 28 67 4e 6f 74 69 | i|f (gNoti|
|000061d0| 66 79 29 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |fy) {. | |
|000061e0| 20 20 4d 79 52 65 73 70 | 6f 6e 73 65 28 28 51 45 | MyResp|onse((QE|
|000061f0| 6c 65 6d 50 74 72 29 67 | 4e 6f 74 69 66 79 29 3b |lemPtr)g|Notify);|
|00006200| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 67 4e 6f |. | gNo|
|00006210| 74 69 66 79 20 3d 20 6e | 69 6c 3b 0d 20 20 20 20 |tify = n|il;. |
|00006220| 20 20 20 20 7d 0d 20 20 | 20 20 7d 0d 20 20 20 20 | }. | }. |
|00006230| 53 65 74 50 6f 72 74 28 | 73 61 76 65 50 6f 72 74 |SetPort(|savePort|
|00006240| 29 3b 0d 7d 0d 56 61 6c | 69 64 20 72 65 73 6f 75 |);.}.Val|id resou|
|00006250| 72 63 65 20 68 61 6e 64 | 6c 65 73 20 66 6f 72 20 |rce hand|les for |
|00006260| 4e 6f 74 69 66 69 63 61 | 74 69 6f 6e 20 4d 61 6e |Notifica|tion Man|
|00006270| 61 67 65 72 20 6e 6d 49 | 63 6f 6e 20 66 69 65 6c |ager nmI|con fiel|
|00006280| 64 0d 57 72 69 74 74 65 | 6e 3a 09 36 2f 33 2f 39 |d.Writte|n:.6/3/9|
|00006290| 31 0d 4c 61 73 74 20 72 | 65 76 69 65 77 65 64 3a |1.Last r|eviewed:|
|000062a0| 09 38 2f 31 2f 39 32 0d | 57 68 79 20 63 61 6e d5 |.8/1/92.|Why can.|
|000062b0| 74 20 49 20 70 61 73 73 | 20 61 20 68 61 6e 64 6c |t I pass| a handl|
|000062c0| 65 20 74 6f 20 61 6e 20 | 27 49 43 4e 23 27 20 61 |e to an |'ICN#' a|
|000062d0| 73 20 74 68 65 20 4e 6f | 74 69 66 69 63 61 74 69 |s the No|tificati|
|000062e0| 6f 6e 20 4d 61 6e 61 67 | 65 72 20 6e 6d 49 63 6f |on Manag|er nmIco|
|000062f0| 6e 20 75 6e 64 65 72 20 | 53 79 73 74 65 6d 20 37 |n under |System 7|
|00006300| 3f 0d 5f 5f 5f 0d 54 68 | 65 20 4e 6f 74 69 66 69 |?.___.Th|e Notifi|
|00006310| 63 61 74 69 6f 6e 20 4d | 61 6e 61 67 65 72 20 63 |cation M|anager c|
|00006320| 68 61 70 74 65 72 20 6f | 66 20 49 6e 73 69 64 65 |hapter o|f Inside|
|00006330| 20 4d 61 63 69 6e 74 6f | 73 68 20 56 6f 6c 75 6d | Macinto|sh Volum|
|00006340| 65 20 56 49 20 64 65 73 | 63 72 69 62 65 73 20 74 |e VI des|cribes t|
|00006350| 68 65 20 6e 6d 49 63 6f | 6e 20 66 69 65 6c 64 20 |he nmIco|n field |
|00006360| 61 73 20 66 6f 6c 6c 6f | 77 73 3a 0d 6e 6d 49 63 |as follo|ws:.nmIc|
|00006370| 6f 6e 3a 20 43 6f 6e 74 | 61 69 6e 73 20 61 20 68 |on: Cont|ains a h|
|00006380| 61 6e 64 6c 65 20 74 6f | 20 61 20 73 6d 61 6c 6c |andle to| a small|
|00006390| 20 69 63 6f 6e 20 74 68 | 61 74 20 69 73 20 74 6f | icon th|at is to|
|000063a0| 20 61 70 70 65 61 72 20 | 70 65 72 69 6f 64 69 63 | appear |periodic|
|000063b0| 61 6c 6c 79 20 69 6e 20 | 74 68 65 20 6d 65 6e 75 |ally in |the menu|
|000063c0| 20 62 61 72 2e 2e 2e 0d | 54 68 65 20 6e 6d 49 63 | bar....|The nmIc|
|000063d0| 6f 6e 20 66 69 65 6c 64 | 20 68 6f 6c 64 73 20 61 |on field| holds a|
|000063e0| 20 68 61 6e 64 6c 65 20 | 74 6f 20 74 68 65 20 69 | handle |to the i|
|000063f0| 63 6f 6e 20 74 68 61 74 | 20 66 6c 61 73 68 65 73 |con that| flashes|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.